Re: [patch] SMP alternatives

From: Ulrich Drepper
Date: Thu Nov 24 2005 - 17:33:57 EST


On 11/23/05, Daniel Jacobowitz <dan@xxxxxxxxxx> wrote:
Those are the wrong ways of doing this in userspace. There are right
ways. For instance, tag the binary at link time "single-threaded".

This works and the system is designed this way. But it's unlikely
that any distribution will ship code like this since the maintenance
is to problematic.


Glibc does not do this to the best of my knowledge. It does select
different code paths in various places based on the presence of
multiple threads, but that's for cancellation, not for locking.

Wrong. Linus is right, we jump over lock prefix. After a lot of
benchmarking I found this to be the fastest was and the Intel people
seemed to agree.


This is also a trivially solvable problem in userspace; you make the
dynamic linker enforce consistency of the tags.

This would require that potentially every single DSO is duplicated as
threaded and non-threaded. If you like this you might as well enter
the horror world of BSD with their libc_r. This will never fly, the
support costs are too high.


The number of userspace libraries that use atomic operations is, in
practice, quite small.

It really not and the number using them is growing.

--
â Ulrich Drepper â Red Hat, Inc. â 444 Castro St â Mountain View, CA â
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/