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 13:29:37 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.vmunix.org!newsfeed.stueberl.de!newsfeed.freenet.de!news.freenet.de!not-for-mail From: Jan Prazak Subject: Re: time-slicing Date: Mon, 15 Jul 2002 22:30:54 -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: "Anders Gidenstam" NNTP-Posting-Host: 213.7.199.44 X-Trace: 1026764976 news.freenet.de 15161 213.7.199.44 X-Complaints-To: abuse@freenet.de Xref: archiver1.google.com comp.lang.ada:27120 Date: 2002-07-15T22:30:54-01:00 List-Id: On Mon, 15 Jul 2002 18:05:58 -0100, Anders Gidenstam wrote: > Hi, > > I think the time-slice is a lot longer than the time it takes to call > Put_Line twice, so it is quite unlikely that you will get a task switch > in the middle. This is an interesting theory. > with Ada.Text_IO; > procedure Task_Test is > > task type Writer (C : Character); > task body Writer is > begin > loop > Ada.Text_IO.Put (C); > end loop; > end Writer; > > A : Writer ('A'); > B : Writer ('B'); > begin > null; > end Task_Test; Yes, this really supports your theory. The output is at least 400*'A', then 400*'B', 400*'A' and so on. So one time-slice is long enough to execute 400 statements. So now there is only one question: how to change the duration? But I suppose that it's not very neccessary to change it. thanks, Jan