Mailing List archive

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

[linux-dvb] Re: Fw: Re: Poll problem with multiple PIDs



Stefan Huelswitt writes:
 > On 19 Jun 2002 <mocm@metzlerbros.de> wrote:
 > 
 > > Well, polling doesn't make sense in blocking mode, so nonblocking is
 > > kind of necessary.
 > 
 > Sure? With poll() in blocking mode I can use the timeout feature
 > which isn't available with a simple read(). Or am I wrong?
 > 

You confuse the blocking done by poll and the blocking mode used for
read/write. If you set a timeout for poll. The process will wait for
that time and see if a non_blocking read/write with data is possible
on the file. If you open a file blocking any read or write will block
until data is read/written. If it is opened non_blocking than
read/write will always return even if no data was read/written, in
which case it will return an EAGAIN.
The poll call with a timeout is better for waiting until data is
available because it is done non busy. You could also use a loop and
just try reading until you get data, but that would be almost the same
as a blocking read. 

Marcus

-- 
/--------------------------------------------------------------------\
| Dr. Marcus O.C. Metzler        |                                   |
|--------------------------------|-----------------------------------|
| mocm@metzlerbros.de            | http://www.metzlerbros.de/        |
\--------------------------------------------------------------------/

 


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index