commandSleep Implementation
commandSleep Implementation
- Subject: commandSleep Implementation
- From: Shyam Sundar <email@hidden>
- Date: Wed, 16 Nov 2005 01:29:58 -0800 (PST)
Hi All,
I have a question about the implementation of commandSleep function in IOCommandGate.
According to the document (both Xcode help and the Description in the Source), the following steps occur when a commandSleep occur:
OpenGate() is called
The thread is put to sleep waiting for an Event
on Event:
CloseGate()
return to the thread context.
Though this dosn't seem to be the case as there is no OpenGate call in the i commandSleep function implementation.(The commandSleep calls its IOEventSource's sleepGate which in turn calls IOWorkloop's sleepGate and IORecursiveLockSleep is returned.)
Are OpenGate and the Sleep operation atomic (it does not seem to be the case). If its not atomic, wouldn't it b!
e
vulnerable to a context switch in between, causing a situation where a CommandWakeup is called before the sleep happens !
What would be the best way to implement a Sleep for a subclass of IOEventSource without the above problems.
-Shyam
Yahoo! FareChase - Search multiple travel sites in one click.
_______________________________________________
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