kthread vs kproc

Julian Elischer julian at elischer.org
Fri Oct 19 23:55:45 PDT 2007


after chatting with alc this afternoon I decided to revive a set of changes I have had sitting around for a time.
Basically I change all teh kthread_xxx calls to kproc_xxx as they all act on processes,
and then introduce a new interface set called kthread_xxx that actually do make threads.

The first step is a wholesale renaming of the old code to 'kproc' with the following patch

http://people.freebsd.org/~julian/kproc.diff

the next step is to introduce the new thread creation code.

(not-yet up to date version below)

The last step is to convert as many of the kprocs as possible to be kthreads.

some (for instance in the aio code I believe) need to remain separate processes.


As Alan and I decided this evening, this has several advantages.
1/ threads have less overhead than processes
2/ creation of kprocs requires locks etc that are problematic in some situations
 while kthreads require a lot less, and can be done in
 a more light weight manner.


if I'd had my witts about me I'd have done this before we branched 7 
to catch any ABI incompatibilities..


oh well.


here's the out of date replacement code:

http://people.freebsd.org/~julian/kthread.diff

I will be updating it...


More information about the freebsd-current mailing list