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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,63360011f8addace X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-07-15 09:09:54 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!bnewspeer01.bru.ops.eu.uu.net!emea.uu.net!newsfeed.freenet.de!news.freenet.de!not-for-mail From: Jan Prazak Subject: Re: gnat: time-slicing Date: Mon, 15 Jul 2002 18:10:33 -0100 Newsgroups: comp.lang.ada Message-ID: References: User-Agent: Pan/0.11.2 (Unix) Mime-Version: 1.0 Content-Type: text/plain; charset=iso885915 Content-Transfer-Encoding: 8bit X-Comment-To: "Dale Stanbrough" NNTP-Posting-Host: 213.7.143.109 X-Trace: 1026749356 news.freenet.de 23709 213.7.143.109 X-Complaints-To: abuse@freenet.de Xref: archiver1.google.com comp.lang.ada:27115 Date: 2002-07-15T18:10:33-01:00 List-Id: On Mon, 15 Jul 2002 07:44:13 -0100, Dale Stanbrough wrote: > The solution is to then do... > > Put_Line ("ab"); > New_Line; > Put_Line ("ab"); This looks like a joke:) The source code was just an example of using tasks, and both tasks have to run at the same time. See also my reply to the reply by David C. Hoos. > If you want to -test- it with different orderings to see how your > program will cope, then you could try putting in... > > random_delay (scale_factor); > > which you will have to write, and will delay for a time from > 0.0..scale_factor seconds. Where should this be placed? This looks like the suggestions from David, he suggested "Delay 0.02" after each Put_Line, but it gives not the result I want. Think of a timer: task Timer is ... ... loop Delay 1.0; Put(current_time); end loop; ... The task uses one Put, which puts current time somewhere on the screen. And this task has to be completely independent from other tasks (= main procedure). There has to be a way to do this with gnat, and that's also my question. I don't want to slow down other tasks with "Delay", just to let Timer-task do the next step (for example when doing some difficult computing, maybe array-sorting or similar things), so there has to be a "direct" way (like a pragma). Thanks, Jan