Re: IOMalloc / IOFree while holding a mutex
site_archiver@lists.apple.com Delivered-To: darwin-kernel@lists.apple.com 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 (Darwin-kernel@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-kernel/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Quinn "The Eskimo!"