• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Kext function SMP locking
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Kext function SMP locking
      • From: "Sven Mutke" <email@hidden>
References: 
 >Kext function SMP locking (From: "Sven Mutke" <email@hidden>)

  • Prev by Date: Kext function SMP locking
  • Next by Date: Re: Kext function SMP locking
  • Previous by thread: Kext function SMP locking
  • Next by thread: Re: Kext function SMP locking
  • Index(es):
    • Date
    • Thread