Subject: Re: Please Revert newlock2
To: None <tech-kern@netbsd.org>
From: Andrew Doran <ad@netbsd.org>
List: tech-kern
Date: 02/21/2007 00:53:30
I spent a while gaining an understanding of the SA code while devising a
locking scheme for it. I saw a number of nasty bugs with it *, and I decided
I wasn't going to spend any more time on it. Why?

 o fixing those bugs properly requires more time+interest than I have.
 o the bugs have remained unfixed for years.
 o from that, there is no prospect of them being fixed.
 o making it MP safe would have requried an overhaul.
 o doing a some things properly with SA (e.g. real time) is Hard.
 o we can match the most important benefit (stack usage) with 1:1.

It's not difficult to construct artifical benchmarks to show for instance,
pthread_cond_wait() is now slower or that thread creation is now slower. Ok,
but we will be tuning the new system as time goes on, and, for most real
world applications 1:1 is only going to bring benefits in the long run.

I think it's important to note that with the release of NetBSD 5.0 we
will be able to provide working pthreads on _all_ platforms, a threading
implementation that works on MP systems, and importantly a threading
implementation that is robust.

Andrew

* It has been pointed out to me that many of the problems were not of
Nathan's making. My reading of the libpthread sources and other code that
Nathan has written only serves to lend credence to that idea for me.