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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.142.102 with SMTP id rv6mr45731567obb.47.1426176453380; Thu, 12 Mar 2015 09:07:33 -0700 (PDT) X-Received: by 10.140.31.134 with SMTP id f6mr733137qgf.33.1426176453344; Thu, 12 Mar 2015 09:07:33 -0700 (PDT) Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!hl2no7370858igb.0!news-out.google.com!db6ni50310igc.0!nntp.google.com!hl2no7370820igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 12 Mar 2015 09:07:33 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=57.79.21.1; posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG NNTP-Posting-Host: 57.79.21.1 References: <8b4d1170-22e6-40d3-8ed1-096dc0163491@m36g2000hse.googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <71b51c8e-6bed-4156-9f52-31bef57b8575@googlegroups.com> Subject: Re: Structure of the multitasking server From: gautier_niouzes@hotmail.com Injection-Date: Thu, 12 Mar 2015 16:07:33 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: number.nntp.giganews.com comp.lang.ada:192458 Date: 2015-03-12T09:07:33-07:00 List-Id: Thanks Jean-Pierre Rosen for this elegant solution! For a very simple simulation framework I need, here is a even simplified variant that is working perfectly. In this case the parameters passed to the task entries are just a job number and the worker's number, for information. procedure Process_parallel is workers: array(1..8) of Worker_type; begin for d in is_driver'Range loop Looking_for_idle: loop for w in workers'range loop select workers(w).Run(d, w); exit Looking_for_idle; else null; -- Worker is busy end select; end loop; end loop Looking_for_idle; end loop; end Process_parallel; _________________________ Gautier's Ada programming http://gautiersblog.blogspot.com/search/label/Ada NB: follow the above link for a valid e-mail address