🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #38270

Re: Submitting to Freenix

#38270
From: T. William Wells
Date: Fri, 25 Jun 1999 00:00
69 lines
3701 bytes
In article <yl3dzg28yw.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
: T William Wells <bill@twwells.com> writes:
: > I don't think it'd be that much slower. Most of the "action" would still
: > take place within each process (or thread).
:
: Except you're going to have to context-switch constantly, which is
: expensive and is definitely going to add to your latency.

A context switch does not involve serious overhead. It's just a
matter of entering the kernel, fiddling a few registers and
loading others, and leaving the kernel. That's CPU time but
measured in microseconds; it's just not terribly significant
compared to other delays. Admittedly, a good thread context switch
is faster, since it can skip the kernel entry/exit, but the
difference just isn't meaningful compared to other slowdowns in
the process.

Ultimately, you can't get rid of the delays -- what you can do is
arrange things so that whenever one part of the system delays,
other parts can take over. The present innd design doesn't allow
that, since the delays processing one input prevent return to the
main loop. A threaded implementation, or a multi-process
implementation, can avoid this problem.

: And the IPC
: will be even worse.

No reason it should be -- in-memory IPC is also going to be
measured in microseconds. It'll take a lot of such things before
they add up to meaningful delays. And given that spreading the
tasks means that one can skip *other* delays, I think it's a win.

: I'm willing to bet that INN as it is currently
: written will have a better latency than such a scheme.

I rather doubt that. INN's primary loop is stuck with delays that
tend to involve disk accesses. For example, no matter how you
slice it, a file create is going to delay the process and that
delay is going to be equivalent to quite a few context switches
indeed.

: By the time anyone finishes a rework of INN to use either processes or
: threads, threads are going to be pretty much as portable as other stuff
: that INN already relies on (like mmap), possibly more so.

INN does not rely on mmap. It can *use* mmap if it's available and
works. But there are still buggy implementations of mmap out
there.... I suspect that'll be the state of affairs regarding
threads, for a long time.

: > Be that as it may, a good design would abstract out the shared data and
: > the multi-processing stuff, so it could be implemented on a variety of
: > platforms.
:
: That's a good ideal.  There are some edge cases that are going to be
: tricky.  Doing an orderly shutdown of the entire system, for one.

True. You'd want to have, as part of the API, a means to say
"don't initiate anything you don't have to". Configuration changes
are another icky kettle of fish.

: But there are other things to work on first.  :)

whispered: (overview)

:)

Technical Details
Message-ID: <7l127f$24lt$1@twwells.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <7g24e7$ckh$1@info.cs.uofs.edu> <ylogi6qrhj.fsf@windlord.stanford.edu> <7ktqaa$k06$1@twwells.com> <yl3dzg28yw.fsf@windlord.stanford.edu>

Show Full Headers
Complete Article Headers
Message-ID: <7l127f$24lt$1@twwells.com>
Subject: Re: Submitting to Freenix
Date: Fri, 25 Jun 1999 00:00:00 +0000
From: bill@twwells.com (T. William Wells)
References: <7g24e7$ckh$1@info.cs.uofs.edu> <ylogi6qrhj.fsf@windlord.stanford.edu> <7ktqaa$k06$1@twwells.com> <yl3dzg28yw.fsf@windlord.stanford.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 493952978
X-Complaints-To: abuse@twwells.com
X-Trace: twwells.com 930352177 70334 209.118.236.61 (25 Jun 1999 23:09:37 GMT)
Organization: None, Mt. Laurel, NJ
NNTP-Posting-Date: 25 Jun 1999 23:09:37 GMT
Newsgroups: news.software.nntp