From: Mark Mielke <mark@mark.mielke.cc>
To: kirk bae <justformoonie@hotmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: So, Poll is not scalable... what to do?
Date: Thu, 13 Nov 2003 19:52:04 -0500 [thread overview]
Message-ID: <20031114005203.GA4425@mark.mielke.cc> (raw)
In-Reply-To: <Law12-F49kTQUM6H2Ht000057a3@hotmail.com>
On Thu, Nov 13, 2003 at 05:10:50PM -0600, kirk bae wrote:
> Is mixing threads with poll uncommon? Is this a bad design? any comments
> would be appreciated.
For a portable solution involving threads, I am fond of using threads to
prioritize the scheduling. For example, a high priority thread could poll()
or select() for (the expected few) high priority events, a medium for medium,
and a low for low. Periodic events, or events that may frequently occur,
may deserve their own blocking thread.
The model probably isn't the simplest to code, though... :-)
I'm most fond of this model as the medium or lower priority threads shouldn't
wake up as often.
Another variant on this that may further reduce the overhead of poll()
is to put events that are expected to occur in the high priority
thread, and events that won't occur for some time in the low priority
thread. This variant would cause problems in the case that priority is
important, and mis-classification of an event would have an
exaggerated cost.
I suppose it really depends on the target application, as to which model
would work best...
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/
next prev parent reply other threads:[~2003-11-14 0:53 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-11-13 23:10 So, Poll is not scalable... what to do? kirk bae
2003-11-14 0:52 ` Mark Mielke [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-11-14 18:57 Frederic Rossi
2003-11-14 0:27 Dan Kegel
2003-11-13 18:25 Dan Kegel
2003-11-11 23:52 kirk bae
2003-11-12 3:52 ` Jeff Garzik
2003-11-12 5:32 ` Willy Tarreau
2003-11-12 23:26 ` bill davidsen
2003-11-13 0:32 ` Davide Libenzi
2003-11-13 0:54 ` Nick Piggin
2003-11-13 12:02 ` Bill Davidsen
2003-11-12 23:23 ` bill davidsen
2003-11-13 1:06 ` Bernd Eckenfels
2003-11-13 7:52 ` David Schwartz
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=20031114005203.GA4425@mark.mielke.cc \
--to=mark@mark.mielke.cc \
--cc=justformoonie@hotmail.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