Re: Kext function SMP locking
Re: Kext function SMP locking
- Subject: Re: Kext function SMP locking
- From: Michael Smith <email@hidden>
- Date: Sat, 24 Feb 2007 01:14:56 -0800
On Feb 23, 2007, at 11:46 PM, Sven Mutke wrote:
I wan't to make sure that a subfunction in a kext is only accessed/
executed by one cpu at a time. I've read about funnels and locks
but perhaps someone can guide me to a quick and recommended solution.
Are you looking for this guarantee because you have static data, or
do you mean that for a given instance of your driver you want to
ensure it is not re-entered?
For the latter, the most common approach is to call the function with
your driver's workloop held. The most common way of doing this is to
ensure that you call the function from an event action; interrupt,
timer or commandgate.
For the former, well, locked static data is mostly a bad idea, but
occasionally when you need it, the easiest way to protect it is with
an IOLock. Be careful not to deadlock yourself, etc.
= Mike
_______________________________________________
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