Boost C++ Libraries: Ticket #9008: [Boost.Interprocess] conditions variables fast enough only when opening a multiprocess browser https://svn.boost.org/trac10/ticket/9008 <p> Hi Boost team, getting a weird behaviour on XP SP3 Boost 1.54.0 (with stlport) </p> <p> Interprocess library example with: </p> <pre class="wiki">comp_doc_anonymous_conditionA.cpp comp_doc_anonymous_conditionB.cpp </pre><p> When running some speed tests the time between two messages (round-trip) is of 15 ms (quite slow for what I need), but if I open a multiprocess browser (Chrome or Firefox 4.0, not with IE8) the speed instantly increases to 1.5 ms which starts to be acceptable to me. If If I minimize the browser the program slows down again. </p> <p> Any idea why is this happening? Is there any fix or workaround for this? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9008 Trac 1.4.3 Marcello Pietrobon <marcello.pietrobon@…> Sat, 17 Aug 2013 23:20:27 GMT <link>https://svn.boost.org/trac10/ticket/9008#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9008#comment:1</guid> <description> <p> I've applied the workaround suggested by Gav Wood in <a class="ext-link" href="http://boost.2283326.n4.nabble.com/Boost-Interprocess-conditions-variables-get-10-times-faster-when-opening-a-multiprocess-browser-td4650763.html#a4650797"><span class="icon">​</span>http://boost.2283326.n4.nabble.com/Boost-Interprocess-conditions-variables-get-10-times-faster-when-opening-a-multiprocess-browser-td4650763.html#a4650797</a> and that seem to be able to completely fix the problem. </p> <p> Even though this problem seems to be entirely due to the inner working of Windows OS, is it possible to optionally implement Gav's workaround in the library, despite all the sensible reservation expressed in the above post, considering that that gives an increase in performance up to almost 1000 times? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Tue, 20 Aug 2013 08:46:14 GMT</pubDate> <title>component changed; owner set https://svn.boost.org/trac10/ticket/9008#comment:2 https://svn.boost.org/trac10/ticket/9008#comment:2 <ul> <li><strong>owner</strong> set to <span class="trac-author">Ion Gaztañaga</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">interprocess</span> </li> </ul> <p> I've replaced all thread_yield with a new yield(unsigned) call that is based on Boost.<a class="missing wiki">SmartPointer</a>'s "yield_k" functions. This function increasingly tries to use heavier wait functions. First mm_pause, then <a class="missing wiki">SwitchToThread/Sleep</a>(0) and finally Sleep(1). </p> <p> Iteration thresholds are taken from Boost.<a class="missing wiki">SmartPointer</a> code, and those might not be optimal for all CPU types, number of concurrent threads, etc. I'll fix the bug with the commit, but reopen it if this doesn't solve the issue. </p> Ticket Ion Gaztañaga Tue, 20 Aug 2013 08:47:18 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9008#comment:3 https://svn.boost.org/trac10/ticket/9008#comment:3 <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> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/85401" title="Fixes #9008">[85401]</a>) Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/9008" title="#9008: Bugs: [Boost.Interprocess] conditions variables fast enough only when ... (closed: fixed)">#9008</a> </p> Ticket marcello.pietrobon@… Wed, 21 Aug 2013 05:44:52 GMT <link>https://svn.boost.org/trac10/ticket/9008#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9008#comment:4</guid> <description> <p> I've run some tests on it and it has improved the performance, but not completely. </p> <p> Clearly this problem is not limited to your interprocess library so I thought to open a different thread discussion for it i the forum: <a class="ext-link" href="http://boost.2283326.n4.nabble.com/Problems-with-yield-k-workaround-Still-too-slow-td4650929.html"><span class="icon">​</span>http://boost.2283326.n4.nabble.com/Problems-with-yield-k-workaround-Still-too-slow-td4650929.html</a> </p> <p> I've done some profiling plus some tests and so it's clear to me that the test program is still slowed down around the ::sleep(1) instruction, and so the value 32 in yield.hpp needs to be replaced with a much higher value. </p> </description> <category>Ticket</category> </item> </channel> </rss>