comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Lundin" <b.f.lundin@gmail.com>
Subject: Re: tasks in queue
Date: Thu, 09 Oct 2014 14:14:44 +0200
Date: 2014-10-09T14:14:44+02:00	[thread overview]
Message-ID: <m15u60$666$1@dont-email.me> (raw)
In-Reply-To: <a1a1c181-ff96-4453-933e-17a4837f0ac3@googlegroups.com>

On 2014-10-09 13:57, Stribor40 wrote:
> 
> But this explanation says also "the Ada definition does not specify which will be serviced first".
> also if in the main you have something like....
> 
> calling .....First_Task
> calling..... Second_Task
> calling......Third_Task
> 
> since this is sequentially executed doesn't that guarantee First_Task will run first?
> 

Well First_Task will be first to start, I think.
But imagine that the scheduler (on a single core machine) stops
First_Task, just after it started, and then gives
Second_Task enough time to complete a full
get-me-food circle.

Then the scheduler changes to the third task and lets it
complete a full circle.

Then First_Task is given attention again, so it could complete its cycle.

You then get Second, Third, and First.


-- 
--
Björn


      reply	other threads:[~2014-10-09 12:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-09 11:57 tasks in queue Stribor40
2014-10-09 12:14 ` Björn Lundin [this message]
replies disabled

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