Re: phtread_create while pthread_cond_timedwait in gdb
- From: malc@xxxxxxxxxxxxx
- Date: Fri, 27 Jun 2008 12:37:17 +0400
David Schwartz <davids@xxxxxxxxxxxxx> writes:
On Jun 26, 8:32 am, arkadius.nowakow...@xxxxxxxxxxxxxx wrote:
Thank you!
I could not find any information about these "bugs".
Didn't nobody came along this until now?
Are there any fixes for this?
I'm sorry, what bug? You are seeing two different behaviors, one with
gdb and one without. But both behaviors are equally reasonable, and
the code doesn't do anything to force one behavior over the other.
http://www.opengroup.org/onlinepubs/000095399/functions/pthread_cond_wait.html
<quote>
The pthread_cond_timedwait() function shall be equivalent to
pthread_cond_wait(), except that an error is returned if the absolute
time specified by abstime passes (that is, system time equals or
exceeds abstime) before the condition cond is signaled or broadcasted,
or if the absolute time specified by abstime has already been passed
at the time of the call.
</quote>
On his system the time has NOT passed yet the call returns ETIMEDOUT,
this contradicts the above text.
On my system the call never returns at all.
This is typical with multi-threaded code. Slight changes in the system
or environment can result in different behavior.
If you care if 'pthread_cond_timedwait' returns early, call it in a
loop.
http://en.wikipedia.org/wiki/Spurious_wakeup
Spurious wakeups have nothing to do with it.
It is not a bug if the same program does two different things under
the same or different conditions unless one of those two things is
unreasonable.
DS
--
mailto:av1474@xxxxxxxx
.
- Follow-Ups:
- Re: phtread_create while pthread_cond_timedwait in gdb
- From: David Schwartz
- Re: phtread_create while pthread_cond_timedwait in gdb
- From: Rainer Weikusat
- Re: phtread_create while pthread_cond_timedwait in gdb
- References:
- phtread_create while pthread_cond_timedwait in gdb
- From: arkadius . nowakowski
- Re: phtread_create while pthread_cond_timedwait in gdb
- From: malc
- Re: phtread_create while pthread_cond_timedwait in gdb
- From: arkadius . nowakowski
- Re: phtread_create while pthread_cond_timedwait in gdb
- From: malc
- Re: phtread_create while pthread_cond_timedwait in gdb
- From: arkadius . nowakowski
- Re: phtread_create while pthread_cond_timedwait in gdb
- From: David Schwartz
- phtread_create while pthread_cond_timedwait in gdb
- Prev by Date: Re: Tftp server problem
- Next by Date: Re: phtread_create while pthread_cond_timedwait in gdb
- Previous by thread: Re: phtread_create while pthread_cond_timedwait in gdb
- Next by thread: Re: phtread_create while pthread_cond_timedwait in gdb
- Index(es):
Relevant Pages
|