DragonFly BSD
DragonFly kernel List (threaded) for 2004-07
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: kernel threads and mplock


To: Hidetoshi Shimokawa <simokawa@xxxxxxxxxxxxxxxxxxx>
From: Hiten Pandya <hmp@xxxxxxxxxxxxx>
Date: Mon, 12 Jul 2004 14:03:22 +0100

Hidetoshi Shimokawa wrote:
Hi,

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 lock.

	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 now. Right?

Right. This will change, though.



/\ Hidetoshi Shimokawa \/ simokawa@xxxxxxxxxxxxxxxxxxx PGP public key: http://www.sat.t.u-tokyo.ac.jp/~simokawa/pgp.html

-Hiten hmp@xxxxxxxxxxxxx



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]