
22 May
2003
22 May
'03
7:10 p.m.
Mark Sizer wrote:
I have a message queue class that has the following API:
post( msg ); msg get();
[...]
Am I missing something or is this "expected" behavior?
Yes, it seems that you're missing something. http://www.boost.org/libs/thread/example/condition.cpp But note that you don't really need to own the mutex ["predictable scheduling" aside] while signaling. Also, certain optimizations are possible for single-consumer and/or single-producer vs. the classic bounded buffer with multiple consumers/producers. Yeah, and you'll NEVER beat Ada's "proxy model"-monitors ("protected objects"). ;-) regards, alexander.