tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Moving pthread_(cond|mutex) to libc

On Tue, Jan 22, 2013 at 06:19:06AM +0100, Emmanuel Dreyfus wrote:
> Starting with NetBSD 6.0, libpthread is cursed with the NOLOAD flag,
> which means it cannot be loaded by dlopen(). The problem is that we can
> easily get to dlopen'able modules that do not use pthreads, but are
> linked to libraries that are linked with -lpthread. Such module cannot
> be loaded anymore in NetBSD 6.0.

So if we want to take the easy way out, we should provide a fake
pthread_create, maybe even as libnothread. It just fails, nothing else.
That means modules and/or main binaries can be linked against it if they
are based on a broken API design without damaging real non-threaded code
in any way.

> It seems there is a conensus that pthread_(cond|mutex) should move to
> libc so that libpthread could be freed from NOLOAD [1]. I started
> looking at it and of course it raises a few problems.

I don't see any such consensus. Such move penalises non-thread
applications and is objectable for that alone.


Home | Main Index | Thread Index | Old Index