Opened 10 years ago
Last modified 4 years ago
#6976 new Bugs
Waiting on boost interprocess condition consumes 100% CPU on Windows
Reported by: | Owned by: | Ion Gaztañaga | |
---|---|---|---|
Milestone: | To Be Determined | Component: | interprocess |
Version: | Boost 1.49.0 | Severity: | Problem |
Keywords: | interprocess condition cpu windows | Cc: |
Description
The problem arises when several threads of several processes waits on same condition. For example, we have application in which we create several threads with thread function like this:
while (_running) { boost::interprocess::scoped_lock<boost::interprocess::interprocess_mutex> lock ( _shm->mutex ) ; // _shm - shared memory _shm->condition.wait ( lock ) ; // condition is boost::interprocess::interprocess_condition }
In main function we simply create several threads, sleep for a some time and stop threads. If we create 4 threads and start 2 applications, or create 3 threads and start 3 applications, or create 2 threads and start 4 applications then we get this problem. Its funny that the problem arising depends on quantity of threads and processes which we start. This is tested on windows 7, windows xp. No problem on Linux system (Debian squeeze)
Any solution for this?