Re: Use of Events in kext
Re: Use of Events in kext
- Subject: Re: Use of Events in kext
- From: Corey O'Connor <email@hidden>
- Date: Wed, 26 Oct 2011 12:47:21 -0700
On Fri, Sep 23, 2011 at 7:45 AM, Ken Hornstein <email@hidden> wrote:
>>I am porting windows code to MAC. In Windows we
>>haveKeWaitForMultipleObjects(), which puts the current thread to wait
>>state until any or all of a number of dispatcher objects are set to a
>>signaled state or (optionally) until the wait times out. My
>>requirement is I need to wait for 2 events at a time until one of them
>>issignaled. In mac we doesn't have events, one of the option is
>>msleep, can anyone suggest any alternatives?
>
> When you say "objects", you're talking about your own code, right?
>
Objects (in this case) on Windows are things like: Mutexes ; Events ;
Processes ; Timers ; Files etc. Pretty much anything with a HANDLE.
(caps intended. Windows devs love caps ) A list of HANDLEs can be
provided to this routine (similarly: the user space routines) to wait
for any of the objects to signal.
I suppose the closest *NIX has to Window's Objects & HANDLEs are file
descriptors. Though these are not directly equivalent. You need to
consider type of objects being waited for to decide what
synchronization primitive to use.
What are these 2 objects?
Cheers,
Corey
See here for some documentation on WaitForMultipleObjects:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms687025(v=vs.85).aspx
_______________________________________________
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