On 09/20/2010 11:24 PM, Amos Jeffries wrote:
On Mon, 20 Sep 2010 17:44:17 -0600, Alex Rousskov wrote:
You might be confusing processes with kids with workers, which is not
surprising given the evolving terminology and overlapping scopes.
Happens to me too, and I wrote or designed most of that code! Kids are
processes started by the Master Process. Watch_child in main.cc of the
Master Process is waiting for them. Coordinator process is one of the
kids.

Workers are Squid-like processes with no specialized function or powers.
They do what "squid -N" does, essentially. Depending on configuration,
there may be no kids, but there has to be at least one worker process.

Why the current code pieces seem correct in isolation, I think we will
change the terminology to something simpler and more coherent once we
have more experience with this stuff. Or perhaps it will feel more
coherent with time :-).

Now is good. Before too many people have played with it and got their
minds around the current naming.

How about:
  kid - "a" process started by Squid for doing "stuff".
  worker - a specialist kid performing HTTP request handling.
  coordinator - specialized process for managing a collection of kids

Currently, that does not account for

(a) no-daemon mode where there is a worker process but no kids. The worker is not a kid in this case.

(b) helper and other processes that are started by Squid for doing "stuff" but that are not kids (there is no corresponding Kid entry for them in the global Kids array managed by the Master Process).


For now we have a special case where coordinator==worker +
unlinkd/pinger/helper specialized kids.

Sorry, not sure what you mean by "coordinator==worker + ..."

Which may or may not be a good thing to carry on into the future, but
certainly simplifies debugging and testing.

If you agree on that the numberOf*() function would be closer to
numberOfWorkers() with no special cases needing mention. It scales to Kids
if you set the affinity for helpers as well.

Would not the no-daemon mode be always special? And if we make helpers into Kids (which is the right thing to do long-term), the no-daemon mode would be even more special because some kids will be started in no-daemon mode while others wont be.

Cheers,

Alex.

Reply via email to