Boost C++ Libraries: Ticket #6549: Really poor named_semaphore performance in Windows https://svn.boost.org/trac10/ticket/6549 <p> I'm experiencing performance issues using named semaphores on Windows 7 x64. Currently, I'm on 1.49 beta 1, but the behavior was similar on 1.48 and 1.47. Below, I'm copying two sets of sample programs. They simply synchronize with one another using a pair of semaphores. To run them, start the first program and then the second. They will synchronize with each other 100k times and then the second program will spit out the elapsed time. You can restart the second program to run again without bringing down the first program. One set uses boost::interprocess named_semaphores. The second uses native win32 api to demonstrate the difference. </p> <p> On Windows, the elapsed time the first time around is anywhere from 20 - 40 seconds. If you leave the second program running, the following run will be only about 2-3 seconds. A third run it will be back up to 20-40 seconds, and it will keep bouncing back and forth like that. The pure Windows implementation completes in only 250ms (up to 160x faster). On Linux, the total elapsed time is consistently less than half a second. </p> <p> Something is up. Wrapping the native semaphores shouldn't slow them down this drastically. Also, the fact that the performance bounces around is another indication that something is seriously wrong. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6549 Trac 1.4.3 Josh Davidson <josh.davidson@…> Mon, 13 Feb 2012 05:19:19 GMT attachment set https://svn.boost.org/trac10/ticket/6549 https://svn.boost.org/trac10/ticket/6549 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test1_win.cpp.txt</span> </li> </ul> <p> Native Windows (1 of 2) </p> Ticket Josh Davidson <josh.davidson@…> Mon, 13 Feb 2012 05:19:45 GMT attachment set https://svn.boost.org/trac10/ticket/6549 https://svn.boost.org/trac10/ticket/6549 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test2_win.cpp.txt</span> </li> </ul> <p> Native Windows (2of 2) </p> Ticket Josh Davidson <josh.davidson@…> Mon, 13 Feb 2012 05:20:11 GMT attachment set https://svn.boost.org/trac10/ticket/6549 https://svn.boost.org/trac10/ticket/6549 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test1_boost.cpp</span> </li> </ul> <p> Boost (1 of 2) </p> Ticket Josh Davidson <josh.davidson@…> Mon, 13 Feb 2012 05:21:07 GMT attachment set https://svn.boost.org/trac10/ticket/6549 https://svn.boost.org/trac10/ticket/6549 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test2_boost.cpp</span> </li> </ul> <p> Boost (2 of 2) </p> Ticket Ion Gaztañaga Thu, 30 Jun 2016 20:31:34 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6549#comment:1 https://svn.boost.org/trac10/ticket/6549#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> We could not reproduce it with the latest version so closing it as fixed. </p> Ticket