Results 1 to 1 of 1
Hi, I'm pretty new to writing linux device drivers and I'm a little confused about the wait_event_interruptible function in the Linux Kernel. Basically I'm trying to write a linux device ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-25-2008 #1
- Join Date
- Oct 2008
wait_event_interruptible and multithreading
I'm pretty new to writing linux device drivers and I'm a little confused about the wait_event_interruptible function in the Linux Kernel. Basically I'm trying to write a linux device driver that requires a process to read data from a buffer. I want to use wait_event_interruptible when data is not available so that my program waits. The deal is though, my application is multithreaded, one thread interfaces with the driver in an infinite loop, continually trying to read, while the other thread runs the rest of the program. I want the thead running the rest of the program to continue without interruption. My question is, if the thread that interfaces with the driver tries to read from the buffer when data isn't available, will just the thread sleep (added to the wait queue) or will the entire process sleep, so the other thread running the rest of the program sleeps as well. Initially I thought this was more of a device driver question, but now that I think about it, I think it more kernel related.
Anyway, if anyone can help with this or point me in the right direction it would be much appreciated.