[MPlayer-dev-eng] Re: kernel: to do_select(pipe) or not to do

Linus Torvalds torvalds at osdl.org
Tue Nov 23 23:04:25 CET 2004



On Tue, 23 Nov 2004, Ivan Kalvachev wrote:

> >  - it doesn't work for regular files (well, it "works" in the sense that 
> >    regular files are never considered to block at all)
> >  - if you use select, you basically have to use O_NONBLOCK, or the 
> >    operation just doesn't make sense.
> 
> Yes. This was my point too. It doesn't make sense. There is no good reason
> select() to forecast block after one written byte, it could do the same
> even on empty or half-full buffer. All three behaviours could be explained
> with same block/nonblock arguing. In all three cases an write may block.

No.

I'm not going to bother answering you any more, since you seem to totally 
ignore all the answers I get.

ALL your problems are from your stupid insistence on a blocking FD. Stop 
it. If the fd is blocking, then it can ALWAYS block, so what "select()" 
returns is totally immaterial. Select could return true, select could 
return false, and select could return _anything_at_all_, and it doesn't 
make any difference what-so-ever.

So using select() with a blocking write is STUPID. The result is 
meaningless. As such, the problem is not in select or in the write, BUT IN 
YOUR USAGE.

Select works correctly. The fact that you can't understand it is _your_ 
problem. 

		Linus




More information about the MPlayer-dev-eng mailing list