Opened 10 years ago

Last modified 4 years ago

#6976 new Bugs

Waiting on boost interprocess condition consumes 100% CPU on Windows

Reported by: tmf83 <tmf83@…> 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)

Change History (2)

comment:1 by anonymous, 5 years ago

Any solution for this?

comment:2 by Ion Gaztañaga, 4 years ago

This problem should be already fixed since Boost 1.55 Release.

Note: See TracTickets for help on using tickets.