From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,a6c65cbc407987fe X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-14 09:10:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!uio.no!news.tele.dk!news.tele.dk!small.news.tele.dk!oleane.net!oleane!nnrp.oleane.net!not-for-mail From: Thierry Lelegard Newsgroups: comp.lang.ada Subject: Re: dynamic multithreading Date: Thu, 14 Nov 2002 18:07:13 +0100 Organization: CANAL+ TECHNOLOGIES Message-ID: <3DD3D841.CD16A4CB@canal-plus.fr> References: NNTP-Posting-Host: host227.canal-plus.fr Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: s1.read.news.oleane.net 1037293633 24145 194.2.208.227 (14 Nov 2002 17:07:13 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Thu, 14 Nov 2002 17:07:13 +0000 (UTC) X-Mailer: Mozilla 4.78 [fr]C-CCK-MCD C+ (WinNT; U) X-Accept-Language: fr,en,zh-CN,zh-TW Xref: archiver1.google.com comp.lang.ada:30886 Date: 2002-11-14T18:07:13+01:00 List-Id: Bj�rn Lundin wrote: > If I remember correctly, there's an example of > a process action as server, listening for new connections. > For each new connection, a new task is created This is generally a bad design. - First, there is performance issue. Creating a new task each time a new connection comes in is a pain on heavily loaded servers. - Second, you must absolutely unchecked_deallocate each task after it is terminated (not always trivial to synchronize on actual termination of a task). Otherwise, you have a memory leak. As an alternative, never let a service task die. Once a task has finished servicing a connection, make it wait and reuse it for a later connection. You may create a finite number of service tasks at startup or create new tasks only when no service task is idle and a new connection arrives. This is not so difficult to design and much more robust. ____________________________________________________________________________ Thierry Lelegard CANAL+ Technologies, 34 place Raoul Dautry, 75906 Paris Cedex 15, France ____________________________________________________________________________