Boost logo

Boost :

From: williamkempf_at_[hidden]
Date: 2001-03-15 17:06:42


--- In boost_at_y..., terekhov_at_y... wrote:
> --- In boost_at_y..., williamkempf_at_h... wrote:
> > --- In boost_at_y..., terekhov_at_y... wrote:
> [...]
> > > i've posted multiple solutions (hopefully correct ones) to
> > > comp.programming.threads/pthread_cond_wait() and
> WaitForSingleObject
> > > if you want, i can post it here or send it directly to you..
> >
> > Either would be helpful.
>
> Newsgroups:
> comp.programming.threads
> Subject:
> Re: pthread_cond_wait() and
> WaitForSingleObject()
> Date:
> Wed, 28 Feb 2001 16:43:36 +0100
>
> ?John Hickin wrote:
> ?
> ?
> ? Doug Schmidt's web site you will find a paper that analyses
several
> ? different approaches to providing posix-like conditional waits,
> ? including one using a CRITICAL_SECTIONs, semaphores, and
> ? SignalObjectAndWait:
> ?
> ? http://www.cs.wustl.edu/~schmidt/win32-cv-1.html
> ?
> ? I can't say it any better than this web page says it:
> ?
> ? ?quote?
> ? This article illustrates why developing condition variables on
> Win32
> ? platforms is tricky and error-prone. There are several subtle
> design
> ? forces that must be addressed by developers. In general, the
> different
> ? implementations we've examined vary according to their
correctness,
> ? efficiency, fairness, and portability. No one solution provides
all
> ? these qualities optimally.
> ? ?/quote?
> ?
> ? Note the final sentence.
> ?
> ? Regards, John.
>
> I would like to add that no solution presented in this paper
> implements condition variables correctly. I've reported to
> ACE/pthread-win32 folks several problems such as lost signal,
> double/nested broadcast deadlock, spurious wakeups,..
> Louis Thomas ?lthomas_at_a...? and I tried to find
> a correct and efficient solution. I think that the following
> solutions (semaphore/event based) implement condition variables
> correctly. I would greatly appreciate it if someone else would
> spend some time verifying the correctness and efficiency of
> the algorithms below.

OK, I need to comment here, and it's going to be possible for my
comments to be construed as a flame or attack, so I'm telling you up
front not to take it this way.

You're not being too helpful here. You stated at one point that
there was "a proper implementation for Win32 available" and that ACE
and pthread-win32 were not it. There are two major problems with
this claim. Firstly, your solutions are "available" only in the
sense that you posted them to the Usenet. There is no available
library using these implementations that I can find (correct me if
I'm wrong). The second problem is that your solutions have not been
evaluated properly yet (again, correct me if I'm wrong).

I've looked at the thread on the Usenet and all the responses I could
find in the archives disagreed with you that the ACE/pthread-win32
solutions were in any way incorrect with regards to the POSIX
standard. Further, I see no responses evaluating any of your
solutions for correctness.

I appreciate that you feel that there is a problem with the
implementation and that you feel that you've solved the problems.
It's also possible (even likely) that both of these are true. The
problem is that you've not come at this from that stand point helping
us to see things your way for the benefit of both.

I'll try to evaluate your solutions, and may well use one of them.
It would be beneficial, though, if you'd offer _opinions_ on them
backed up with evidence to help in the evaluation. It would be even
more beneficial if some other group had evaluated your solutions
prior to this groups evaluation (bearing in mind that this group is
full of C++ experts but has few people that are _truly_ "expert" in
multi-threaded programming).

Bill Kempf


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk