Re: apache style squid?

From: Michael O'Reilly <michael@dont-contact.us>
Date: 09 Oct 1997 16:04:49 +0800

"Andres Kroonmaa" <andre@ml.ee> writes:
> > Only if it's a REALLY bad scheduler. If they are sleeping on some
> > mutex, then they shouldn't be on the run queue.
>
> Well, to detect that thread is idle on a mutex, scheduler has to do some
> work, things just doesn't happen byitself ;) even if the overhead
> is neglible
> I still don't see the point in keeping idle threads around.

Umm. Only if it's a REALLY bad scheduler. Most sched's will only
examine processes on the run queue, and as soon a thread sleeps, it'll
get removed from the run queue, and placed on the wait queue for
whatever it's sleeping on. When when event X happens, all the threads
waiting on X are moved back onto the run queue.

i.e. a sleeping thread has not negligable overhead, but zero
overhead for the scheduler.
 
> > I think you're missing the point. There is only one writer. It's a
> > pre-condition. You simply set it up so there is only every one writer
> > for an object, and voila! it happens.
>
> OK, I missed that. But it's quite hard to setup and would add other
> kind of overhead, IMO. Also, this doesn't scale well on Cray ;)
> Why I dislike single writer is because it is most simple and
> straightforward
> to code threads from accept() to the last close() as independant and
> all equal, all searching and updating metadata as needed, without a need
> for mama-thread... or even worse - mama-process...

I think you're still missing the point. It's not that only one thread
can write, but for any one variable, at any one point in there, this
is a only a single thread that could possibly write to the
variable. This is fairly easy to setup.

> Somebody could test, how OS would behave when having about 2000
> processes doing shared mem locks and trying to do something useful.
> You see, when you have very many processes, kernel has to do much
> more work in scheduler to find next runnable process.

Like, for example, take the first thing on the run queue, and run
it..??? :) I don't think your looking at how modern schedulers
work. They certainly aren't O(n) on the number of processes!
Received on Tue Jul 29 2003 - 13:15:43 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:11:26 MST