Re: threads

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

 



Anticipating a Reply (ruxyz@yahoo.com) wrote:
> Hi ,
> 
> Refer "Linux Device Drivers" for information 
> about sleep_on_timeout(),pg 142,........
> 
> Hope this helps .
> 
> Regards !
>  --- R Gowri <rgowri@neomagic.com> wrote: > Hi All,
> > 
> > I want to wait for an event and timeout after a
> > specific time period 
> > specified.
> > 
> > And it should also wait upon an event, on whose
> > occurence it will 
> > conrtinue with the initial processing.
> > 
> > While waiting it should not use CPU cycles.
> > 
> > I want to know how to implement this.
> > 
> > just to be more clear,
> > 
> > say... sleep(5), when this is sleeping if in the 3rd
> > second the event 
> > arrives it should go to its signal handler or
> > whatever and continue with 
> > the initial processing before it started sleeping.
> > 
> > sleep can't be interrupted.
> > 
> > so how should I implement it?
> > 
> > Thanks.
> > Gowri.

Have a look to ldd ( http://linux-study.cs.ccu.edu.tw/ldd2nd/  )
If you want to have it interruptible and timeout:
interruptible_sleep_on_timeout(wait_queue_head_t *queue, long timeout);

-- 
Cordialement/Regards
+-------------------------------------------------------+
| Christophe Lucas -- IOMEDA SA (clucas@iomeda.fr)      |
| Developpeur/Administrateur GNU/Linux                  |
+-------------------------------------------------------+
| http://titux.tuxfamily.org -- Registered User #271267 |
+-------------------------------------------------------+
--
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