This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
Re: performance improvement in cygthread::detach()
- From: Christopher Faylor <cgf at redhat dot com>
- To: cygwin-developers at cygwin dot com
- Date: Fri, 9 May 2003 13:59:04 -0400
- Subject: Re: performance improvement in cygthread::detach()
- References: <3EBBE154.2060107@hekimian.com>
- Reply-to: cygwin-developers at cygwin dot com
On Fri, May 09, 2003 at 01:11:48PM -0400, Joe Buehler wrote:
>There is a timing race. On a fast dual-processor machine (e.g.) the
>separate reader thread can be done before the first
>WaitForSingleObject() call in the code above. SetEvent will be called
>twice before detach() does its first test. This means that the second
>WaitForSingleObject() will wait 5 mS for an event that will never
>arrive, since raw_read() already did two SetEvent() calls.
Yes, I'm aware of the potential for a 5ms wait. Since it only happens
rarely in the event of a signal, I didn't think it was a big deal. The
multiple event setting was intended to be a hint not a real
synchronization point.
However, I'll rewrite it to get rid of the 5ms wait.
cgf