Re: Wait Queues
Re: Wait Queues
- Subject: Re: Wait Queues
- From: Quinn <email@hidden>
- Date: Wed, 5 Mar 2003 21:38:20 +0000
At 12:38 -0800 5/3/03, Vivek Balasubramanyam wrote:
There isn't a specific need to use wait queues over any other kind
of synchronization, since only one thread is ever in the queue. But
I do need to use something that will let this thread sleep until a
separate thread sends a wakeup signal (when the buffer goes from
empty to non-empty).
I get the feeling you're barking up the wrong tree here.
Specifically, if you have an I/O Kit driver that installs a character
device, Mach primitives are probably too low-level. Instead, you
should probably be using BSD primitives, such as "sleep" and
"wakeup". Of course, to use these from within a I/O Kit driver, you
have to manually acquire the appropriate BSD funnel.
You can see all of this in the IOSerialBSDClient driver, which is
Apple's code to shim from I/O Kit into a BSD character device.
<
http://www.opensource.apple.com/cgi-bin/registered/cvs/IOSerialFamily/IOSerialFamily.kmodproj/IOSerialBSDClient.cpp?rev=1.1.1.3&content-type=text/x-cvsweb-markup>
[APSL account required]
Another option might be to publish *two* nubs from your driver, the
first one being the actual modem and the second being the monitoring
device. I/O Kit will then match IOSerialBSDClient on top of each,
and you can let it shim you into BSD.
S+E
--
Quinn "The Eskimo!" <
http://www.apple.com/developer/>
Apple Developer Technical Support * Networking, Communications, Hardware
_______________________________________________
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.