Boost logo

Threads-Devel :

Subject: Re: [Threads-devel] Fwd: cond.timed_wait() returns way after deadline?
From: Anthony Williams (anthony_at_[hidden])
Date: 2009-07-10 06:00:30


Stefan Steuerwald wrote:
> Thank you for your comments, for curiosity I have tested both
> orderings, no apparent difference.
> My predicate has nothing to do with the notify code anyway.
>
> I can just do an isolated cond.timed_wait() call, and sometimes the
> deadline just passes, and it still sits there!!!
> I have verified that my clock is unchanged. No clue yet.

boost::condition_variable is just a thin wrapper around a pthread_cond_t
on linux. If this is not working, that suggests one of two things: (a)
pthread_cond_timedwait is broken on linux or (b) your logic and/or
synchronization for when to wait or notify is broken.

Though (a) is not impossible, I'm inclined to go for (b).

Can you show us a complete but minimal example that demonstrates the
problem?

Anthony

-- 
Author of C++ Concurrency in Action | http://www.manning.com/williams
just::thread C++0x thread library   | http://www.stdthread.co.uk
Just Software Solutions Ltd         | http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

Threads-Devel list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk