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
