Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 May 1997 11:15:42 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        julian@FreeBSD.ORG (Julian Elischer)
Cc:        hackers@FreeBSD.ORG
Subject:   Re: Thundering herd.
Message-ID:  <199705311815.LAA10977@phaeton.artisoft.com>
In-Reply-To: <199705310322.UAA17301@freefall.freebsd.org> from "Julian Elischer" at May 30, 97 08:22:51 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> hmm with processes doing a select on a socket..
> 
> here's an example from a ktrace'd kernel.

[ ... ]

> one 'wakeup' and a whole bunch of processes were woken up..
> can't we do better than that?
> this is in 2.2+
> 
> julian
> 
> p.s. yes it only wasted 10mSec (probably less without ktrace)
> but I thought we had got around this..

You need to implement a mux instead of a multiple select on a
signle socket.  The mux then only delivers to a single processes
"socket".

I think your netframe stuff is a perfect match for this problem.

As an optimization, I suggest using LIFO ordering to determine
which process gets the select() coming true: if they are anonymous
work-to-do-engines (which they can be, using a mux), then the last
one in is most likely to have all its data pages in core.  This
technique is called "hot engine scheduling" (incidently, it was
my design for the NetWare for UNIX product's queuing preference).


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199705311815.LAA10977>