Subject: [Boost-bugs] [Boost C++ Libraries] #7657: Serious performance and memory consuption hit if condition_variable methods condition notify_one or notify_all is used repeatedly
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-11-07 16:00:17
#7657: Serious performance and memory consuption hit if condition_variable methods
condition notify_one or notify_all is used repeatedly
-------------------------------------------------------+--------------------
Reporter: Petr Dannhofer <petr.dannhofer@â¦> | Owner: anthonyw
Type: Bugs | Status: new
Milestone: To Be Determined | Component: thread
Version: Boost 1.52.0 | Severity: Showstopper
Keywords: |
-------------------------------------------------------+--------------------
platform: Win32, MSVS11
condition_variable::generations member contains list of
basic_cv_list_entry instances. As notify_one or notify_all is called, each
instance member release is called, setting basic_cv_list_entry::notified
member to true. There is no code which set basic_cv_list_entry::notified
to false again, so the entry stays notified forever.
Items from condition_variable::generations are deleted only when there are
no waiters for the entry. The waiters are removed in
entry_manager::~entry_manager. New addition to 1.52 version is that waiter
is removed only if the entry is not notified (line 198
thread/win32/condition_variable.hpp).
As result, new entries are added for every get_wait_entry() call, which
means for every wait call (as waiter can be added only to unnotified
entry, which is the same story all over again),
condition_variable::generations vector grows infinitely, consuming memory
and processor time for useless searches for entries that could be removed.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7657> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC