kthread vs kproc

From: Julian Elischer <julian_at_elischer.org>
Date: Fri, 19 Oct 2007 23:45:22 -0700
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...
Received on Sat Oct 20 2007 - 04:55:45 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:19 UTC