But what happens when there is data on the fd. i.e a user process had done
a select on the fd, the select call in tunr called the poll method of the
device, which returned saying there was no data. SInce there was a timeout
specified in select, the process was pu to sleep. Now, two things might
happen, either the data arrives on the fd(considering it is a read fd), or
timeout happened. So how is process awakened when there is data on the fd
before timeout.
when data arrives there wud be an interrupt from the NIC which wud
in turn call the ISR , which is supposed to wake up the sleeping
process on the wait_queue. thats how i beleive the sleeping process is
woken up in the first case.
So here, does the process that writes something to the fd
call wake_up_interruptible and then the select call for our
original(reading) process return ?
Here, what if there is no second process, one process is trying to read
from an fd, and that fd has a read buffer in the kernel, and some other
module function itself writes on that buffer, so here it should be
responsibility of this module function to call wake_up_interruptible, right
?
yes, that is true , the writing function has to wake_up all sleeping
processes on the wait_queue. becoz there is no interrupts being
generated to wake up the sleeping process , as in the first case.
Well, I tried reading rubini once to clear things up but since i have
doubts, i though this was the best place to clear them.
thanks
Amit
HTH, iam a newbie too, correct me if iam wrong anywhere.
cheers,
Amit with an 'h' ;-) !
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/