comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adambeneschan@gmail.com>
Subject: Re: Strange behavior
Date: Fri, 5 Sep 2014 18:35:45 -0700 (PDT)
Date: 2014-09-05T18:35:45-07:00	[thread overview]
Message-ID: <187cf5b0-92ca-4e42-9982-2f97907a00b3@googlegroups.com> (raw)
In-Reply-To: <pcmk0al1qsiecjsodb39ubr676dokrlov1@4ax.com>

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 can
> occur. 

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 preempting 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 same priority, at any time.  

The Intel i960 processor supports time slicing, in which there's a timer that counts down, and when it hits 0, the processor will automatically switch to another process with the same priority.  That process is then allowed to 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 involvement.  This is one of the processors ICC Ada is targeted to, and we took advantage of that feature; this was done back when Ada 83 was the standard, and there were no task dispatching policies and the dispatching mechanisms were pretty much left up to the implementor with just a few requirements.  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 little different--I haven't studied it.

                             -- Adam


  reply	other threads:[~2014-09-06  1:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-05 19:30 Strange behavior Laurent
2014-09-05 19:47 ` sbelmont700
2014-09-05 20:05   ` Laurent
2014-09-06  0:53     ` Dennis Lee Bieber
2014-09-06  1:35       ` Adam Beneschan [this message]
2014-09-05 20:23 ` Jeffrey Carter
2014-09-05 20:48   ` Robert A Duff
2014-09-05 20:34 ` Robert A Duff
2014-09-05 20:40   ` Laurent
2014-09-06  1:10     ` Dennis Lee Bieber
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox