From: "Nikola Milutinovic" <Nikola.Milutinovic@ev.co.yu>
Subject: Re: Inter process communication
Date: Thu, 16 May 2002 07:31:56 +0200 [thread overview]
Message-ID: <abvh8j$5qj$1@Mercury.ev.co.yu> (raw)
In-Reply-To: 3ce0ad01$1@news.post.ch
> What we have is a multi threaded server process with n working threads,
> which should spread the workload over n worker single threaded processes.
> Each work thread should store the comm channel (msgq, socket, pipe ...) in
> his own thread specific data. So each thread always contacts the same
worker
> process.
The way I've seen people using threads is:
- there is one (or more) process that is the SERVER
- server has multiple threads, one of them is LISTENER, others are WORKERS
- listener accepts requests and dispatches it to one of the workers
- there can be an additional thread, POOLER, which monitors the number of
free workers and creates/destroys them if need be
In this implemenatation, workers do not have comm channel information (and
really, they shouldn't). Each time there is a request, listener will take
it, re-package it (if need be) and hand it over to a worker thread. If you
opt for sockets, listener will pass the socket pointer to a worker and
continue to listen on the socket descriptor for the next request.
Nix.
prev parent reply other threads:[~2002-05-16 5:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-05-13 8:50 Inter process communication Jakob Erber
2002-05-14 5:20 ` Nikola Milutinovic
2002-05-14 6:21 ` Jakob Erber
2002-05-16 5:31 ` Nikola Milutinovic [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox