How to signal a semaphore for APC thread in a DIRQL thread?

Discussion in 'Windows Vista Drivers' started by Jin, Aug 16, 2008.

  1. Jin

    Jin Guest

    Is there something similar to keReleaseSemaphore that I call in DIRQL? If
    not, is there a way that I can signal a waiting APC thread from DIRQL thread?

    Any advice would be greatly appreciated. Thanks!
     
    Jin, Aug 16, 2008
    #1
    1. Advertisements

  2. Jin

    Don Burn Guest

    No there is no way to signal at DIRQL. You need to have the DIRQL fire off
    a DPC request then handle it in the DPC at DISPATCH_LEVEL.

    --
    Don Burn (MVP, Windows DDK)
    Windows 2k/XP/2k3 Filesystem and Driver Consulting
    Website: http://www.windrvr.com
    Blog: http://msmvps.com/blogs/WinDrvr
    Remove StopSpam to reply
     
    Don Burn, Aug 16, 2008
    #2
    1. Advertisements

  3. Jin

    Jin Guest

    Thanks, Don.

    I just curious why this is not allowed. So it seems I have to either queue
    DPC or spin in APC. Would that be performance hit?
     
    Jin, Aug 16, 2008
    #3
  4. Jin

    Don Burn Guest

    The model for (most) Windows drivers is do the minimal work in the ISR, such
    as save the data and dismiss the interrupt, then in the DPC process as much
    as you can including notifying things like other threads. Spinning in the
    APC is not a good way for anything.


    --
    Don Burn (MVP, Windows DDK)
    Windows 2k/XP/2k3 Filesystem and Driver Consulting
    Website: http://www.windrvr.com
    Blog: http://msmvps.com/blogs/WinDrvr
    Remove StopSpam to reply
     
    Don Burn, Aug 16, 2008
    #4
  5. Jin

    Jin Guest

    Thanks again for insights, Don.

    I have an ISR that receives data (4 bytes) from a hardware and a APC thread
    processes it. I'd like to let ISR somehow notify the APC and also let APC
    sleep when no data is available. Is there some support in windows to
    implement this model?
     
    Jin, Aug 16, 2008
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.