[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gdb
Subject:    Re: [greg@surety.com] libc/1320: pthread_cond_timedwait returns EINTR in multithreaded processes whe
From:       Kevin_Hendricks <khendricks () admin ! ivey ! uwo ! ca>
Date:       1999-09-24 17:52:15
Message-ID: 21510.938195549.0 () NO-ID-FOUND ! mhonarc ! org
[Download RAW message or body]


Hi,

>SUS2 says that pthread_cond_timedwait must never return with EINTR.  If it
>is interrupted it must either continue waiting or return zero.  I think
>continue waiting is the desired action.
>
>I'm not sure whether this is the right way to fix the bug.

Are you sure you want to do this?  

Before we started using pthread_cancel and longjmping out of the cleanup handler 
clean-up handler, the JDK (Blackdown) used to use a signal to interrupt threads 
waiting in condvar_timed_wait and relied on the EINTR to do the trick.

The problem with this approach was that it could miss signals, but people may 
still want to be able to break out of timed_waits (you can implement 
condvar_wait with condvar_timed_wait and break out of both with a signal).

What does the pthreads spec say about condvar_timed_wait and returning EINTR?

My 2 cents,

Kevin




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic