Jason Thorpe has merged the nathanw_sa branch with -current. NetBSD now has a high performance, modern kernel thread implementation using Scheduler Activations in the main source tree. This work was performed by Nathan Williams with contributions by several other developers.
Does anyone know the difference between ${SUBJECT}?
I know that OpenBSD and NetBSD are very closely related and that often code for one will apply to the other. Does anyone know if this means that OpenBSD might get better pthreads? If I understand correctly, pthreads on OpenBSD is pretty poor.
@RJW: I think KSEs are the actual threads that are running on the kernel, i.e. all threads on Linux, or processes on BSD.
SA are some piece of code that pings the process from time to time to have it preemptively (i.e. non-cooperatively) schedule another user-level thread.
@Oscar Boykin: I’m writing this on a NetBSD behind an OpenBSD router I think OpenBSD track a lot of features from the NetBSD tree, but they don’t have that many developers, so it might take some time. Their priorities are elsewhere, and anyone who likes kernel-threads (I do) can just fork() instead of creating threads. I think this why there’s no Mozilla or Gnome/Nautilus on OpenBSD (Nautilus not even on Net’), but KDE seems to run just fine on both (though I haven’t tried it).
Also of course, SA are only in the -current tree, so this isn’t for production systems anyway.
See http://www.unixdaemons.com/~hiten/docs/freebsd_kse.pdf for details. Sections 2.4 and 3 could be out of your interest.
“I think this why there’s no Mozilla or Gnome/Nautilus on OpenBSD”
That is incorrect. Mozilla and Gnome work on OpenBSD.
I have had many trouble with pthreads in netbsd/openbsd and it sounds like they were done in userspace or something before. many times one thread wouldn’t even run! anyway my main interest is in openbsd and I hope this code finds its way across the project boundary.
Previously, NetBSD had no pThreads in base system at all. There were several implementations (not by NetBSD) in the pkgsrc, and — of course — they were all userspace. Dunno how OpenBSD implements its threads.
Re: Ulrich Hobelmann:
What do you mean by “anyone who likes kernel-threads can just fork()”. Kernel threads, at least in NetBSD, are just plain processes, which run in the kernel context. And in any case fork() doesn’t create threads, but separate processes, which in several ways can’t be used like threads.