Locking and synchronization primitives
Locking and synchronization primitives
- Subject: Locking and synchronization primitives
- From: Wally Crooze <email@hidden>
- Date: Mon, 12 May 2003 17:29:48 +1000
G'day,
I've been investigating the different locking/synchronization primitives
with respect to different OS kernels. In darwin it appears that there
are generally two places to look for primitives... mach (ofsmk) or bsd.
Reading the Kernel Programming guide the section Synchronization
Primitives outlines the recommended primitives, which are defined by the
mach.
So... I attempted to use spinlocks with the simple_lock interface
(defined in kern/simple_lock.h), but kept getting the complaint "passed
2 arguments, but takes just 1" for simple_lock_init. What I found was
that a redefinition of the simple_lock interface was made in sys/lock.h
and simple_lock and simple_unlock functions do nothing, which overrides
kern/simple_lock.h. I can't avoid including this because it is brought
in by sys/vnode.h, and many other headers.
Does anybody know why simple_lock interfaced is redefined and why the
lock and unlock do nothing? I need this to work on a multiprocessor
machine... and this doesn't appear to help.
Also, are the other interfaces for locking/synchronization described in
Kernel Programming correct? Should I be using different interfaces in
BSD from mach? What does monotreme mean?
Note. I am writing a filesystem... so I can't avoid using BSD headers.
Thanks.
--
Wally Crooze
+-------------------------------------------------------+
| ,-_|\ Wally Crooze <email@hidden> |
| / \ |
| \_,-._/ |
| v |
+-------------------------------------------------------+
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.