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-Thread: 103376,cd2c81bea5127375 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news1.google.com!news.glorb.com!feeder.erje.net!news.ecp.fr!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: Starting a Task and Immediately Returning Date: Fri, 14 Nov 2008 16:13:00 +0100 Organization: Adalog Message-ID: References: <2ec689f1-8dc6-4cd8-b7f8-d0b7311317cc@h23g2000prf.googlegroups.com> <811556bd-60c9-43c0-927d-0e5d093dcfbd@i18g2000prf.googlegroups.com> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1226672329 11458 195.25.228.57 (14 Nov 2008 14:18:49 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Fri, 14 Nov 2008 14:18:49 +0000 (UTC) User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) In-Reply-To: <811556bd-60c9-43c0-927d-0e5d093dcfbd@i18g2000prf.googlegroups.com> Xref: g2news1.google.com comp.lang.ada:2676 Date: 2008-11-14T16:13:00+01:00 List-Id: Maciej Sobczak a �crit : > On 14 Lis, 14:26, Graham Stark >> But, >> obviously, you can't wait 10 minutes to reply to a web request. > > Then you need a task that will exist independently on Web_Callback. > Make such a task (or even a whole bunch of them if that makes sense > for this particular server) at the library level, which will give them > independence on any scope. Add some facility for communicating to this > task the description of what needs to be done (the "job") - for this > you can use rendezvous or (better) job queue(s). Or more simply, create the task with an allocator (new). The tricky thing will be to deallocate the tasks' space after it is terminated. Web server are generally expected to run 24/7, so no memory leak allowed... -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr