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,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ec570d1a83fda83c X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-26 13:31:09 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!logbridge.uoregon.edu!news.huji.ac.il!not-for-mail From: "Ehud Lamm" Newsgroups: comp.lang.ada Subject: Re: Problem with tasks Date: Thu, 26 Jul 2001 23:28:51 +0300 Organization: The Hebrew University of Jerusalem Message-ID: <9jpujh$158$1@news.huji.ac.il> References: <3b5e887e.10671695@news.bt.es> NNTP-Posting-Host: di4-40.dialin.huji.ac.il X-Trace: news.huji.ac.il 996179378 1192 132.64.14.40 (26 Jul 2001 20:29:38 GMT) X-Complaints-To: abuse@news.huji.ac.il NNTP-Posting-Date: Thu, 26 Jul 2001 20:29:38 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2014.211 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Xref: archiver1.google.com comp.lang.ada:10613 Date: 2001-07-26T23:28:51+03:00 List-Id: Ted Dennison wrote in message news:HbX77.7784$ar1.25497@www.newsranger.com... > In article <3b5e887e.10671695@news.bt.es>, Carlos Aganzo says... > > > >I need to create a new instance of the same task from itself, > > First off, this sounds like you designed a system around the "fork" concept, and > are now trying to plug that into Ada. You'll have a lot easier time if you > *design* from Ada too. Maybe. But sometimes the design call for this type of behaviour, and it has nothing to do with forking. > If you want to dynamicly create tasks in Ada, you should be using task types. > You can create pointers to task type objects, put them in arrays, dynamicly > allocate and deallocate them, etc. You can even create them from within > themselves, if you *truly* need something like "fork". That type of activity can > lead to "fork-bomb" errors though. > Right. That's why a good design would make use of a task-allocator abstraction, which may allocate a new taks, but may later be changed to manage a finite sized pool of tasks (the "thread pool" pattern). Ehud Lamm