Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Aug 2001 12:29:38 -0400
From:      Sandeep Joshi <sandeepj@research.bell-labs.com>
To:        freebsd-hackers@freebsd.org
Subject:   long-term kernel locks
Message-ID:  <3B813AF2.BC7C726@research.bell-labs.com>

next in thread | raw e-mail | index | archive | help

Hi there,

I need some mechanism to hold long-term locks (across
context switches) while using kernel threads (kthread_*)
and lockmgr() looked like the right thing to use.

I am running FreeBSD 4.1 on a uniprocessor (..the questions
are similar with 4.3)

Looking at kern_lock.c, I see that lockmgr() uses simple
locks.  On a UP system, simple locks are turned off.
I dont see any way to prevent a context switch while the
kernel thread is in the lockmgr code - after going
thru a simple_lock() call.  Is this correct ?

So my questions are :
1) Is lockmgr safe ?
2) Are there other sync primitives that can be used 
   between two kernel entities (i can move to 4.3)
3) What is the use of simplelock_recurse in
   kern_lock.c ?

TIA,
-Sandeep

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B813AF2.BC7C726>