From: Paul Marquis <pmarquis@iname.com>
To: root@chaos.analogic.com
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: select() bug
Date: Thu, 02 Nov 2000 17:58:25 -0500 [thread overview]
Message-ID: <3A01F191.10652E1F@iname.com> (raw)
In-Reply-To: <Pine.LNX.3.95.1001102173819.18044A-100000@chaos.analogic.com>
In the code sample, there is a loop that is run four times. During
each iteration, a call to select() and write() is done, while every
other iteration does a read(). Between the 1st and 2nd calls to
write(), as well as the 3rd and 4th, select() fails, but all write()'s
and read()'s succeed. There is no code bug.
Richard B. Johnson wrote:
> On Thu, 2 Nov 2000, Alan Cox wrote:
>
> > > that are log file handlers are dead. If select() reports it can't
> > > write immediately, Apache terminates and restarts the child process,
> > > creating unnecessary load on the system.
> >
> > Is there anything saying that select has to report ready the instant a byte
> > would fit. Certainly its better for performance to reduce the context switch
> > rate by encouraging blocking
> >
>
> It looks as though, when select() is reporting that the pipe is
> NOT writable, the code writes anyway -- then complains that it
> could be written.
>
> This is a code bug. The pipe can certainly become writable during
> the time interval between when it was checked by select() and the
> attempt to write the byte.
>
> Cheers,
> Dick Johnson
>
> Penguin : Linux version 2.2.17 on an i686 machine (801.18 BogoMips).
>
> "Memory is like gasoline. You use it up when you are running. Of
> course you get it all back when you reboot..."; Actual explanation
> obtained from the Micro$oft help desk.
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> Please read the FAQ at http://www.tux.org/lkml/
--
Paul Marquis
pmarquis@iname.com
If it's tourist season, why can't we shoot them?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2000-11-02 22:58 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-02 22:11 select() bug Paul Marquis
2000-11-02 22:27 ` Alan Cox
2000-11-02 22:42 ` Richard B. Johnson
2000-11-02 22:58 ` Paul Marquis [this message]
2000-11-03 0:53 ` Richard B. Johnson
2000-11-03 5:00 ` Paul Marquis
2000-11-03 13:05 ` Richard B. Johnson
2000-11-02 22:53 ` Paul Marquis
2000-11-02 22:58 ` Alan Cox
2000-11-02 23:08 ` Paul Marquis
2000-11-02 23:20 ` Alan Cox
2000-11-02 23:44 ` Paul Marquis
2000-11-02 23:53 ` H. Peter Anvin
2000-11-02 23:46 ` David S. Miller
2000-11-03 0:04 ` H. Peter Anvin
2000-11-02 23:52 ` David S. Miller
2000-11-03 0:13 ` H. Peter Anvin
2000-11-03 0:05 ` David S. Miller
2000-11-03 0:38 ` H. Peter Anvin
2000-11-03 0:01 ` Alan Cox
2000-11-02 23:55 ` Alan Cox
2000-11-03 5:52 ` dean gaudet
2000-11-03 7:05 ` Marc Lehmann
-- strict thread matches above, loose matches on Subject: below --
2000-11-05 16:14 Stanislav Meduna
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3A01F191.10652E1F@iname.com \
--to=pmarquis@iname.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=root@chaos.analogic.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox