Re: IOMalloc / IOFree while holding a mutex
Re: IOMalloc / IOFree while holding a mutex
- Subject: Re: IOMalloc / IOFree while holding a mutex
- From: "Quinn \"The Eskimo!\"" <email@hidden>
- Date: Tue, 22 Nov 2011 09:59:00 +0000
On 21 Nov 2011, at 06:03, sheetal phirke wrote:
> I am writing IOKit driver with Vnode & File listener.
> Is it safe for me to take mutex lock while IOMalloc / IOFree?
I think that would be a very bad idea. Listeners in the vnode scope are potentially on the page out path (because the pager might need to create a new swap file), which makes allocating memory in your code potentially dangerous, regardless of whether you're holding a mutex or not.
Share and Enjoy
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
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