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

Re: Threads


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 24 Sep 2008 22:15:19 -0700 (PDT)

:Thanks. Regarding MP Lock, i was actually going through lwkt_switch() function
:in lwkt_thread.c. there mpheld is used and MP_LOCK_HELD()assign value to that variable. The 
:paragraph above it tries to explain it, but it confused me.
:
:So i was asking when MP Lock comes into play? when to check if mp lock is held or not and so on.
:
:--Mayur

    That's code you will only see in the lwkt_switch() code, and nowhere
    else.  The lwkt_switch code has to match up the actual state of the MP
    lock against the state recorded in the thread it is switching into.

    In all other code the actual state of the MP lock will match the state
    recorded in the thread (as part of td_pri).

					-Matt
					Matthew Dillon 
					<dillon@backplane.com>



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