9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "John S. Dyson" <toor@y1.jdyson.net>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] Re: Any significant gotchas?
Date: Wed, 12 Jul 2000 12:08:17 +0000	[thread overview]
Message-ID: <8khlvt0114e@enews1.newsguy.com> (raw)
In-Reply-To: <sharris@sch1.NCTR.FDA.GOV>

In article <396BD2AC.9BA22564@anu.edu.au>,
	Jason Ozolins <jason.ozolins@anu.edu.au> writes:
> Scott Schwartz wrote:
> 
>> | a select()-based approach is orders of magnitude better at throughput
>> | and maximum number of connections.
>> 
>> And yet people are constantly writing papers about how select() and poll()
>> are too inefficient, and proposing various other schemes.
> 
> Maybe so, but how does that increase the merit of spawning lots of
> threads just to get select()-like behaviour, if the experience on other
> OSs suggests that the thread approach is even less efficient than
> select()?
> 
> If people have some references to articles on approaches other than
> fd-per-thread or traditional select(), could they maybe post them to the
> group?
> 
I haven't run benchmarks for this problem exactly, but depending on
the technique for threading, you can end up with severe performance
problems due to the cache not being able to map the entire range
of memory required by the threads.  Some multi-threading schemes
require a different stack for every thread (perhaps both in user
and in kernel mode.)  The jumping from stack frame to stack frame
fills the cache very nicely :-).

A distributed kernel development that I have put on hold doesn't depend
on kernel stacks for per-process (or thread) kernel context.  This
begs the issue of the user space stack, but a carefully designed user
level multi-threading scheme might be able to minimize the user stack
needs also (in certain circumstances.)

There are some places where multi-threaded implementations for I/O
concurrency are better than poll() type implementations and vice
versa.  I implemented AIO on FreeBSD as a threaded scheme, so as
to avoid modifying the entire framework for all of the I/O types.
For RAW disk I/O, I did place hooks into the code, and had a table
driven scheme so that the optimizations to avoid threads could be
added over time.

John


  parent reply	other threads:[~2000-07-12 12:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <sharris@sch1.NCTR.FDA.GOV>
2000-07-11 21:10 ` Stephen C. Harris
2000-07-11 21:20   ` Scott Schwartz
2000-07-12  9:31     ` Jason Ozolins
2000-07-12 12:08 ` John S. Dyson [this message]
     [not found] <10007111441.ZM757223@marvin>
2000-07-12 13:39 ` Stephen C. Harris
2000-07-12 14:43 jmk
2000-07-12 14:55 ` Greg Hudson
2000-07-14  9:20   ` Wesley Felter
2000-07-14 14:55     ` Douglas A. Gwyn
2000-07-12 16:36 ` John S. Dyson

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=8khlvt0114e@enews1.newsguy.com \
    --to=toor@y1.jdyson.net \
    --cc=9fans@cse.psu.edu \
    /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;
as well as URLs for NNTP newsgroup(s).