Re: wait_event_interruptible and wake_up_interruptible

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

 



On Thu, Jun 10, 2004 at 10:45:04 +0530, aksingh@hss.hns.com wrote:
> 
> 
> 
> 
> so,
>   this is what i got from your mail
> 
> all same module functions
> 
> read() {
> calls wait_event_interruptible.
> /*here the input buffer we need some data on is nothing but a char array in
> the module, on which some data is written by other functions within the
> module */
> }
> 
> func_2{
> /*this writes on that char buffer, which was empty and because of which the
> current process was put to sleep in read() */
> so now this shld do this;
> 1. fill the char buffer
> 2. wake_up_interruptible
> }

Just wake_up. That's what I was trying to explain. That way it does not
matter whether read() uses wait_event_interruptible or wait_event and
won't cause trouble if you later decide to change it (eg. because
something makes interrupt handling too tricky).

wake_up wakes up every process on a waitqueue, no matter what state it
was in.

-------------------------------------------------------------------------------
						 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