Boost C++ Libraries: Ticket #13212: Windows: condition_variable::notify_one consumes semaphore handles https://svn.boost.org/trac10/ticket/13212 <p> When condition_variable receives lot of notify_one-calls, it reserves many semaphore handles. Test program consumes over 30 handles per second in my computer. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13212 Trac 1.4.3 henri.hakonen@… Thu, 14 Sep 2017 16:37:35 GMT attachment set https://svn.boost.org/trac10/ticket/13212 https://svn.boost.org/trac10/ticket/13212 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">condition_variable_test.cpp</span> </li> </ul> <p> Test program </p> Ticket henri.hakonen@… Thu, 14 Sep 2017 16:38:20 GMT attachment set https://svn.boost.org/trac10/ticket/13212 https://svn.boost.org/trac10/ticket/13212 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">handles.png</span> </li> </ul> <p> Handles </p> Ticket viboes Sat, 16 Sep 2017 15:23:19 GMT owner, status, summary changed https://svn.boost.org/trac10/ticket/13212#comment:1 https://svn.boost.org/trac10/ticket/13212#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Anthony Williams</span> to <span class="trac-author">viboes</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>summary</strong> <span class="trac-field-old">condition_variable::notify_one consumes semaphore handles</span> → <span class="trac-field-new">Windows: condition_variable::notify_one consumes semaphore handles</span> </li> </ul> <p> I've no access to a Windows machine. Please, could you count the number of notify_one per second? </p> Ticket viboes Sat, 16 Sep 2017 16:41:55 GMT <link>https://svn.boost.org/trac10/ticket/13212#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13212#comment:2</guid> <description> <p> See <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/11457" title="#11457: Bugs: windows - boost::recursive_mutex leaks event handles when lock ... (closed: worksforme)">#11457</a> </p> </description> <category>Ticket</category> </item> <item> <author>harris.pc@…</author> <pubDate>Fri, 18 May 2018 06:15:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13212#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13212#comment:3</guid> <description> <p> A note, perhaps not useful, but regardless: </p> <p> I thought I had a handle leak in my program on windows 7/10, so I used this test code to try out this particular possibility. </p> <p> I tested the attached code test with Boost 1.60.0 + MSVC2010, and it worked as expected - ie no handle leak. </p> <p> And now I can't seem to reproduce the problem in my program. So I can't be sure if it was just a windows quirk that has magically gone away. </p> <p> Sorry I don't have something more useful to share </p> </description> <category>Ticket</category> </item> <item> <author>henri.hakonen@…</author> <pubDate>Fri, 18 May 2018 14:30:29 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/13212#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13212#comment:4</guid> <description> <p> It seems that problem is gone now when I test with boost 1.67.0. There is no leak anymore. </p> <p> I think that this problem was specific to boost 1.65.0. My quick fix was to comment one line in condition_variable.hpp. (here X: (upper) is my version of 1.65.0 and E: (lower) is original boost. </p> <p> X:\boost\thread\win32&gt;fc condition_variable.hpp e:\prj\boost_git\libs\thread\include\boost\thread\win32\condition_variable.hpp Comparing files condition_variable.hpp and E:\PRJ\BOOST_GIT\LIBS\THREAD\INCLUDE\BOOST\THREAD\WIN32\CONDITION_VARIABLE.HPP <strong></strong>* condition_variable.hpp </p> <pre class="wiki"> // do it here to avoid throwing on the destructor //entry-&gt;remove_waiter(); locker.lock(); </pre><p> <strong></strong>* E:\PRJ\BOOST_GIT\LIBS\THREAD\INCLUDE\BOOST\THREAD\WIN32\CONDITION_VARIABLE.HPP </p> <pre class="wiki"> // do it here to avoid throwing on the destructor entry-&gt;remove_waiter(); locker.lock(); </pre><p> <strong></strong>* </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Tue, 07 Aug 2018 12:24:31 GMT</pubDate> <title>status changed; resolution set; milestone deleted https://svn.boost.org/trac10/ticket/13212#comment:5 https://svn.boost.org/trac10/ticket/13212#comment:5 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-deleted">To Be Determined</span> </li> </ul> <p> Thanks for the information. </p> <p> Already fixed. </p> Ticket