Subject: Re: Pthreads, libc, and the future
To: Michael Graff <explorer@flame.org>
From: Jason Thorpe <thorpej@nas.nasa.gov>
List: tech-userlevel
Date: 12/10/1999 21:35:19
On 10 Dec 1999 15:44:12 -0800 
 Michael Graff <explorer@flame.org> wrote:

 > (2)  libc should be finished off as a thread-safe library, using
 >      _REENTRANT as the que.  To do that, pthread.h (or, more
 >      specifically, the definitions of locks and such) needs to be
 >      present.  This means two things:
 > 
 > 	(a)  Changing the threads interface in a major way might
 > 	require a libc version bump, or at the least a synchronized
 > 	update of libpthread.so and libc.so.
 > 
 > 	(b)  It will tie us down to one specific implementation of
 > 	threads.  Since it includes our installed pthreads.h file,
 > 	another implementation will _not_ work in its place, unless
 > 	libc is compiled using its pthread.h file.

You have this exactly backwards.

First, identify the dependencies which you think libc would have on
the pthreads implementation.  One such dependency is locks.

What we should do here, instead, is provide those primitives in our
libc, and then make the pthreads package build on top of those!

I think there hasn't been enough thought put into this, so I would
think importing it any time soon (especially this weekend!) would be
a serious mistake.

        -- Jason R. Thorpe <thorpej@nas.nasa.gov>