Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Nov 1996 17:08:24 -0600 (CST)
From:      Joe Greco <jgreco@brasil.moneng.mei.com>
To:        terry@lambert.org (Terry Lambert)
Cc:        jgreco@brasil.moneng.mei.com, proff@suburbia.net, hackers@FreeBSD.org
Subject:   Re: Programming technique for non-forking servers?
Message-ID:  <199611142308.RAA26489@brasil.moneng.mei.com>
In-Reply-To: <199611142228.PAA24870@phaeton.artisoft.com> from "Terry Lambert" at Nov 14, 96 03:28:02 pm

next in thread | previous in thread | raw e-mail | index | archive | help
Was wondering when Terry would jump in..

> Threading in general has advantages over not threading.
> 
> *Kernel* threading has advantages in terms of SMP scalability.
> 
> Whether or not to consider *threading at all* is something that should
> be done independent of considering *kernel threading in particular*.

Threading in general has the distinct advantage of being moderately
portable: i.e. you can expect it not to work right somewhere.  :-)

> > Kernel level support for threading (or threads in general, for that matter)
> > may not be particularly portable in any case.
> 
> It will be irrelevant, being hidden below a POSIX API, no matter how
> it is implemented by the underlying system.

"Oh."

Well, what "will" be is irrelevant, because right now, what "is" does not
necessarily fit my notion of irrelevancy.

I agree that this should be the goal.  I disagree that what you are
saying exists today - because it does not.

> The POSIX threading uses signals to initiate context switches using a
> user space threads scheduler.

Hmmmm.

> > I guess I would not consider this viable unless someone told me up front
> > that there was a single platform that was being targeted, and there was
> > a clear advantage to the use of threads in the given context, and the
> > thread support on the platform in question was known to be good.
> 
> The clear advantage is context sharing between multiple threads of
> execution (which could be processes or threads or whatever) *without*
> resorting to UNIX IPC, which is (to say the least) arcane.  As a side
> benefit, context switch overhead is reduces between threads in the same
> thread group (the definition of a process), assuming that you don't
> implement your threads like SVR4 and Solaris implemented their kernel
> threads.

Assume I am familiar with the Solaris threads model.  The reason that
POSIX threads have reduced cxsw overhead is that signals are used?  (I
honestly do not know).

In any case, I usually try to be pessimistic when I write code.  That
probably means that I will not be writing threaded code for several
more years, at least if I plan to use the program under more than one
OS.  That is simply pessimism on my part about "POSIX threads".  ;-)

... JG



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