Re: poll device function

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

 



On Wed, Jun 09, 2004 at 21:52:48 +0200, Tyler wrote:
> aksingh@hss.hns.com wrote:
> >
> >
> >
> >Hi,
> >
> >  I am implementing a poll function for my char device, there is a standard
> >procedure of doing it,
> >
> >1. poll_wait(give yr wait_queues address here);
> >
> >2. then see if there is something to be read/write, set a mask and return
> >to user.
> >
> >but here drivers dont seem to add the current process to the waitqueue,
> >before calling poll_wait, so does poll_wait does this for them ?
> >
> >regards
> >Amit
> >
> yes exactly. poll_wait adds a wait queue in the pollwait table of the 
> kernel. When an event occurs (write of data for example), the process is 
>  awaken.

It's not that exact. The original poster seems to assume, that poll_wait
sleeps. But it does not. It just gathers the waitqueues. And only when
->poll methods of all watched descriptors have been called, and said
they don't have events, only then the process is put to sleep on all
those queues at once.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

Attachment: signature.asc
Description: Digital signature


[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