From: "David Schwartz" <davids@webmaster.com>
To: <jcwren@jcwren.com>, <linux-kernel@vger.kernel.org>
Subject: RE: select() - Linux vs. BSD
Date: Sun, 3 Jun 2001 00:52:36 -0700 [thread overview]
Message-ID: <NCBBLIEPOCNJOAEKBEAKMEKIPHAA.davids@webmaster.com> (raw)
In-Reply-To: <NDBBKBJHGFJMEMHPOPEGIEBCCIAA.jcwren@jcwren.com>
> I would have said just the opposite. That if it you have a large
> number of
> handles you're waiting on, and you have to go back through and
> set the bits
> everytime you timeout that you would incur a larger overhead. From the
> perspective of my application, it would have been more efficient
> to not zero
> them (I was waiting on a number of serial channels, and the
> timeout was used
> to periodically pump more data to the serial channel. When I
> received data,
> I buffered it, and another thread took care of processing it).
The usual implementation is you have a 'permanent' fd_set and a 'temporary'
fd_set. Before each call to select, you memcpy the permanent fd_set into the
temporary and pass the temporary to select. If you wish to stop selecting
for read or write on a given socket, you remove it from the appropriate
permanent set. This way you don't have to twiddle too many bits.
DS
next prev parent reply other threads:[~2001-06-03 7:52 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-03 2:47 John Chris Wren
2001-06-03 3:31 ` Mike Castle
2001-06-03 7:52 ` David Schwartz [this message]
-- strict thread matches above, loose matches on Subject: below --
2001-06-01 17:33 Andries.Brouwer
2001-06-01 8:16 Andries.Brouwer
2001-06-01 16:38 ` lost
2001-06-02 21:46 ` Jamie Lokier
2001-06-03 2:13 ` lost
2001-05-29 15:55 John Chris Wren
2001-05-29 17:34 ` Mike Castle
2001-05-29 19:51 ` Alan Cox
2001-05-29 20:50 ` lost
2001-05-29 21:06 ` dean gaudet
2001-05-31 1:40 ` Dr. Kelsey Hudson
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=NCBBLIEPOCNJOAEKBEAKMEKIPHAA.davids@webmaster.com \
--to=davids@webmaster.com \
--cc=jcwren@jcwren.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®