Re: interruptible_sleep_on() vs wait_event_interruptible()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

> is the only reason not to use interruptible_sleep_on() because of the
> race between when the driver
> decides to sleep and when the sleep_on is performed?
>
> I have an application that use lots of interrupts so missing one isn't
> a problem.
>
> what is the best way to make the event in wait_event_interruptible()
> atomic?
> can that be done with set_bit() and test_bit()?

If I understand you correctly, you have a wrong view point in this situation. 
wait_event_interruptible cannot be called from interrupt context. Because 
interrupt context is atomic so you cannot sleep from it. 

A typical scenario is waiting from process context using 
wait_event_interruptible or derivatives and then in interrupt code waking up 
those processes.

--
Bora SAHIN

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux