From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,f37007e903458d32 X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2002-05-16 00:45:00 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!proxad.net!npeer.kpnqwest.net!EUnet.yu!Mercury.ev.co.yu!not-for-mail From: "Nikola Milutinovic" Newsgroups: comp.unix.tru64 Subject: Re: Inter process communication Date: Thu, 16 May 2002 07:31:56 +0200 Organization: EPS Elektrovojvodina Message-ID: References: <3cdf7e4f$1@news.post.ch> <3ce0ad01$1@news.post.ch> NNTP-Posting-Host: brigitte.ev.co.yu X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Xref: archiver1.google.com comp.unix.tru64:7679 > 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.