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.68.190.130 with SMTP id gq2mr541309pbc.3.1409967346460; Fri, 05 Sep 2014 18:35:46 -0700 (PDT) X-Received: by 10.50.80.42 with SMTP id o10mr102437igx.4.1409967346351; Fri, 05 Sep 2014 18:35:46 -0700 (PDT) Path: border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!r2no15276998igi.0!news-out.google.com!aw9ni0igc.0!nntp.google.com!r2no15276993igi.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 5 Sep 2014 18:35:45 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=KSa2aQoAAACOxnC0usBJYX8NE3x3a1Xq NNTP-Posting-Host: 66.126.103.122 References: <6967b17b-acb9-4b44-b21a-6ddcab1e1065@googlegroups.com> <8c587c07-fde3-45c7-8d8e-c3541ea4e0e4@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <187cf5b0-92ca-4e42-9982-2f97907a00b3@googlegroups.com> Subject: Re: Strange behavior From: Adam Beneschan Injection-Date: Sat, 06 Sep 2014 01:35:46 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: number.nntp.dca.giganews.com comp.lang.ada:188889 Date: 2014-09-05T18:35:45-07:00 List-Id: On Friday, September 5, 2014 5:53:11 PM UTC-7, Dennis Lee Bieber wrote: > However, a task switch can take place on ANY operation that hands off > to the OS -- that means any I/O call is a point at which a task switch ca= n > occur.=20 Just to clarify, task switches can take place at any time, not just when an= OS operation occurs, depending on the task dispatching policy. For a pree= mpting policy, a lower-priority task can be preempted by a higher-priority = task as soon as something happens to make the higher-priority task ready to= run; the task being preempted doesn't need to be anywhere near an OS call.= For a round-robin policy, a task can also be preempted by a task of the s= ame priority, at any time. =20 The Intel i960 processor supports time slicing, in which there's a timer th= at counts down, and when it hits 0, the processor will automatically switch= to another process with the same priority. That process is then allowed t= o execute for a certain time, but when its timer hits 0, the processor will= switch again to another process, possibly the first one. There's no OS in= volvement. This is one of the processors ICC Ada is targeted to, and we to= ok advantage of that feature; this was done back when Ada 83 was the standa= rd, and there were no task dispatching policies and the dispatching mechani= sms were pretty much left up to the implementor with just a few requirement= s. However, I believe that the Round_Robin_Within_Priorities policy (since= Ada 2005) is essentially the same as how this processor works; it might be= exactly the same, but there could be some nuances that would make it a lit= tle different--I haven't studied it. -- Adam