DragonFly kernel List (threaded) for 2004-07
Re: kernel threads and mplock
Hidetoshi Shimokawa wrote:
I have a question about kernel threads synchronization on DFB.
A comment in lwkt_thread.c says:
* NOTE! By default new threads are created with the MP lock held. A
* thread which does not require the MP lock should release it by calling
* rel_mplock() at the start of the new thread.
Where can I find an example for thread running without MP lock?
The LWKT scheduler and the systimer code runs without the MP
If you want an example of how and where it is released, then
checkout, i386/i386/vm/vm_machdep.c, kern/init_main.c, also
kern/kern_clock.c, kern/kern_switch.c, kern/kern_synch.c and
last but not the least, i386/i386/trap.c.
I heard that TCP protocol stack has multiple kernel threads.
Do they actually run concurrently on multiple cpu now?
I can't find where they release MP lock.
There are still a few bits which need to be finished before the
network is actually free of the MP lock.
It seems that most of the kernel threads are running with MP lock
Right. This will change, though.
/\ Hidetoshi Shimokawa
PGP public key: http://www.sat.t.u-tokyo.ac.jp/~simokawa/pgp.html