Re: about IOMemoryDescriptor
Re: about IOMemoryDescriptor
- Subject: Re: about IOMemoryDescriptor
- From: Michael Smith <email@hidden>
- Date: Wed, 8 Sep 2010 09:51:10 -0700
On Sep 8, 2010, at 2:23 AM, sheetal phirke wrote: I have read about IOMemoryDescriptor: Drivers can access user-space memory by creating an IOMemoryDescriptor instance based on a virtual address in a given task and then preparing and mapping the descriptor.
So is it possible to create semaphore object in user, pass it to kernel & map that memory into kernel so that i can access same semaphore in kernel? i try to do this, but IOMemoryDescriptor::map() failed. i want to do this for synchronization between user & kernel...
You should not do this, as you have no mechanism for avoiding priority inversions if you invent your own blocking synchronisation primitives.
If you are trying to provide a form of mutual exclusion, look at some of the lockless strategies for sharing data and combine them with the OSAtomic operations.
= Mike
-- The lyf so short, the craft so long to lerne -- Chaucer
|
_______________________________________________
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