apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <...@rkbloom.net>
Subject Re: locks/win32/thread_cond.c
Date Tue, 01 Jun 2004 22:42:37 GMT


On Tue, 1 Jun 2004, [UTF-8] Branko ─îibej wrote:

> Klaus Keppler wrote:
>
> > Hello Ryan,
> >
> >>> b. In apr_thread_cond[_timed]_wait cond->mutex and mutex are reset
> >>>   multiple times, why?
> >>
> >
> >> I don't know.  I'll need to dig into this.
> >
> >
> > Recently I wrote a multithreaded application and tested it with
> > heavy load under both linux and windows.
> > The proposed patch (bugzilla #27654) takes care of releasing
> > the mutex (given by parameter) only once; without the "unlock_once"
> > workaround the apr_thread_cond_(timed)wait function ran into a
> > deadlock situation after some loops.
>
> We shouldn't be writing patches for the Win32 thread_cond code. We
> should start from scratch, correctly. The current code has so many race
> conditions it's not even funny. My apologies to the authors, but it
> really is naive.

Yes, it is naive.  I didn't want to write the code at all, but we needed
an implementation.  What I wrote worked well enough to pass the tests, but
I was always hoping somebody would re-write it to use the correct Windows
APIs.  :-)

Ryan


Mime
View raw message