Thread sleep
Thread sleep
- Subject: Thread sleep
- From: Eric Long <email@hidden>
- Date: Thu, 10 Sep 2009 13:44:27 -0700
- Thread-topic: Thread sleep
Hi,
I have a kext that sends data to a daemon via an IODataQueue. The daemon
processes the data and sends back a response to my IOUserClient.
The thread that enqueues the data must have the response or time-out before
continuing. The response obviously comes on a separate thread.
Ideally, the enque thread will go to sleep and be woken up by the response
handler. The problem is there is a window for a race condition between when
the enque thread is actually asleep and when the response arrives and the
handler wants to wake it up. This leaves the potential that the thread is
not asleep and therefore not ready to be woken up.
The thread primitives that might allow me to check if the thread is sleeping
are not exposed in the kpi.
Anyone with advice on how to reconcile this?
Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden