Front page | perl.perl5.porters |
Postings from May 2003
Re: Meaning of sysread()
Thread Previous
|
Thread Next
From:
Mark Mielke
Date:
May 22, 2003 11:27
Subject:
Re: Meaning of sysread()
Message ID:
20030522183315.GB32761@mark.mielke.cc
On Thu, May 22, 2003 at 08:24:47AM +0100, Nick Ing-Simmons wrote:
> Mark Mielke <mark@mark.mielke.cc> writes:
> >> >For Perl read(), we don't care, because read() is buffered and is not
> >> >affected by the same performance issues mentioned earlier. Reading one
> >> >byte at a time is not expensive for buffered PerlIO handles.
> >> Nor necessary! as PerlIO can "unread" abitrary amount of data,
> >> and :encoding snoops the buffer a perl-ish manner, and ...
> >Unless select() is emulated as well to peek at the PerlIO buffers, this
> >is not true.
> select() says a read(2) will not block. It says nothing about read(),
> readline() in perl or fread() in stdio world.
Unless PerlIO is 'unreading' data back to the kernel, something that I was
not aware you could do under UNIX, select() may block while the 'unread'
data is sitting in a PerlIO buffer.
mark
--
mark@mielke.cc/markm@ncf.ca/markm@nortelnetworks.com __________________________
. . _ ._ . . .__ . . ._. .__ . . . .__ | Neighbourhood Coder
|\/| |_| |_| |/ |_ |\/| | |_ | |/ |_ |
| | | | | \ | \ |__ . | | .|. |__ |__ | \ |__ | Ottawa, Ontario, Canada
One ring to rule them all, one ring to find them, one ring to bring them all
and in the darkness bind them...
http://mark.mielke.cc/
Thread Previous
|
Thread Next