Is not barrier suitable for that?<br><br>Regards,<br>Ovanes<br><br><div class="gmail_quote">On Tue, May 5, 2009 at 12:42 PM, Anthony Williams <span dir="ltr"><<a href="mailto:anthony.ajw@gmail.com">anthony.ajw@gmail.com</a>></span> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">Zachary Turner <<a href="mailto:divisortheory@gmail.com">divisortheory@gmail.com</a>> writes:<br> <br> > I've been trying to figure out if there's a simple way using condition<br> > variables and mutexes to design a function with the following properties<br> > (cliffs notes first, and then longer version in case it's not enough info):<br> ><br> > 1) there is a section of code in the function such that two threads cannot<br> > enter that section at the same time.<br> > 2) after leaving the section of code, the thread should wait for something to<br> > happen (signalled by another thread)<br> > 3) the waits in step 2 should be awoken in the order they occured.<br> <br> </div>There's nothing in boost to do this. I remember a thread on<br> comp.programming.threads about a FIFO mutex (which is what you seem to<br> want). Someone provided an implementation (which may well do what you<br> want), but the consensus seemed to be "don't do that". If your program<br> behaviour depends on threads being woken in a specific order then it may<br> be better to rewrite the code so it doesn't.<br> <br> Anthony<br> --<br> Author of C++ Concurrency in Action | <a href="http://www.manning.com/williams" target="_blank">http://www.manning.com/williams</a><br> just::thread C++0x thread library � | <a href="http://www.stdthread.co.uk" target="_blank">http://www.stdthread.co.uk</a><br> Just Software Solutions Ltd � � � � | <a href="http://www.justsoftwaresolutions.co.uk" target="_blank">http://www.justsoftwaresolutions.co.uk</a><br> 15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976<br> <br> _______________________________________________<br> Boost-users mailing list<br> <a href="mailto:Boost-users@lists.boost.org">Boost-users@lists.boost.org</a><br> <a href="http://lists.boost.org/mailman/listinfo.cgi/boost-users" target="_blank">http://lists.boost.org/mailman/listinfo.cgi/boost-users</a><br> </blockquote></div><br>