IssueRaiser

The fundamental problem with this pattern in C++ is that you can always just keep around a pointer into it and then the "mutex guard" thi...

The fundamental problem with this pattern in C++ is that you can always just keep around a pointer into it and then the "mutex guard" thing falls apart. There's no way to communicate to the language that this pointer can't hang around any longer than the mutex guard (because that's the only thing preventing the pointer from being racy). You basically can't write safe abstractions in C++ in the face of pointers.

Posted by Gankro on Jul 18, 2015, 4:21 AM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.5,500 issues0 comments

hackernews (Other)

The fundamental problem with this pattern in C++ is that you can always just keep around a pointer into it and then the "mutex guard" thi...

GankroJul 18, 2015, 4:21 AM

The fundamental problem with this pattern in C++ is that you can always just keep around a pointer into it and then the "mutex guard" thing falls apart. There's no way to communicate to the language that this pointer can't hang around any longer than the mutex guard (because that's the only thing preventing the pointer from being racy). You basically can't write safe abstractions in C++ in the face of pointers.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue