libkse to libpthread switch on FreeBSD
Dan writes "Daniel Eischen says that libkse has been renamed back to libpthread and is now the default threads library. The gcc-pthread option has also been changed to link to libpthread instead of libc_r. For alpha and sparc64 machines, libkse has not been renamed and links are installed so that libpthread points to libc_r. FreeBSD GNOME team's Joe Marcus Clarke confirmed that the ports system will switch to using libpthread as the default for PTHREAD_LIBS shortly. A patch set is currently being tested, once that completes, the necessary port hooks will be in place to easily build applications linked to libpthread."
... according to some, but I think it's rather useful. The old saying "Don't put your eggs in one basket" applies. (Friendly) Competition is good for open source software - witness KDE and Gnome's attempts to out-innovate eachother.
I don't think for one minute that SCO's claims about Linux are legitimate, but imagine if they were: and some idiot judge ordered that Linux distribution was stopped. I think all the BSD trolls might be glad of an alternative kernel and userland under those circumstances!
"Kernel threads" will now be the default instead of "user threads." (Many BSDers cringe at this use of the term "kernel threads," since to them it represents the misapplication of a term apropriate only to a thread that runs entirely within the kernel. But the above is a usage common in the Linux world.)
This is a key step on the way to finishing the work for FreeBSD 5 and moving on to FreeBSD 6. It incorporates a highly sophisticated (some would say over-sophisticated) M:N threading system; this is where a new kernel-scheduled context is created only for threads that the userland scheduler thinks may block as opposed to having a kernel context for each thread like Linux does. It remains to be seen if the theoretical advantages of this approach will be turned into real-world advantages. I suspect that it will be a while before we know; although libkse has proven stable of late, there will be lots of additional experience acquired now that it is the default and no doubt this will result in further tuning.
Congrats to the FreeBSD team! This and the (not entirely unrelated) SMPng subsystem were the biggest steps on the way to getting FreeBSD 5 ready to take the FreeBSD mantle. It was a gamble going this route rather than the "safe" alternative of a 1:1 model, and there were times when a number of folks wondered if libkse would ever be finished. Well, now it is!
With the latest OS release, Sun's default
thread library is 1:1. It seems Sun got
tired of fighting with the complexity.
The real-world complexity tends to eat up
any theoretical performance advantages of
an M:N model.
Sure there isn't some obscure ioctl() that
will block a thread or cause some other sort
of trouble when you generate a new thread?
KSE is Kernel Schedulable Entities, and it's most definitely not 1:1.
FreeBSD has just moved from default user space threading to default scheduler activations.
Scheduler actications can be used to get M:N threading, which is the most commonly expected use, and they can also be used for 1:1.
Effectively, this announcement indicates that libthr, which is the native 1:1 threading for FreeBSD by Jeff R. lost out to libkse, and libc_r (user space threading) lost out to both of them.
-- FYI