term1 Definition1term2 Definition2term3 Definition3
Please sign in to your Google account to access your documents:
What is the problem with this code, and how to fix it?
If cout throws an exception, our mutex will be locked forever, use RAII to fix it.
There is still a problem here, what is it?
cout is a global resource, other processes could write to it as well.
Here is a way you could approach to handling this.
What is the problem with this class, assuming synchronization is handled correctly?
The interface of this class is not thread safe. top and pop should be combined(and still it would not be safe if there is an exception, that is why STL is not thread safe).
Need help typing ? See our FAQ (opens in new window)
Please sign in to create this set. We'll bring you back here when you are done.
Discard Changes Sign in
Please sign in to add to folders.
Sign in
Don't have an account? Sign Up »
You have created 2 folders. Please upgrade to Cram Premium to create hundreds of folders!