• 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: Problem with semaphore_wait & its correct usage.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with semaphore_wait & its correct usage.


  • Subject: Re: Problem with semaphore_wait & its correct usage.
  • From: Terry Lambert <email@hidden>
  • Date: Mon, 6 Aug 2007 20:32:22 -0700

On Aug 6, 2007, at 8:01 PM, JanakiRam wrote:
         I'm writing a kext driver , using semaphore calls. My
application is hanging when the semaphore_wait is executed.

You need to read Chapter 15 of the Kernel Programming Guide: Semaphores. It's located here:


<http://developer.apple.com/documentation/Darwin/Conceptual/KernelProgramming/synchronization/chapter_15_section_2.html >

Obvious errors:

- Your start/stop functions incorrectly return success when they shouldn't.
- The semaphore may not be initialized
- You may permit an unload while the PC for some thread is still in the KEXT (panic)


-	You're sleeping a different semaphore than you wake up

Have you considered using an IOCommandQueue or IOCommandGate instead?

<http://developer.apple.com/documentation/Darwin/Reference/KernelIOKitFramework/IOCommandGate/Classes/IOCommandGate/CompositePage.html >

-- Terry

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Problem with semaphore_wait & its correct usage. (From: JanakiRam <email@hidden>)

  • Prev by Date: Re: CPAN make problem on OS X 10.4
  • Next by Date: Re: Integrating an external UPS system?
  • Previous by thread: Problem with semaphore_wait & its correct usage.
  • Next by thread: does sysctl.proc_exec_affinity affect grand-children processes?
  • Index(es):
    • Date
    • Thread