comp.lang.ada
 help / color / mirror / Atom feed
From: Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject: Re: Concurrency in Ada
Date: Sun, 07 Sep 2014 11:05:53 -0400
Date: 2014-09-07T11:05:53-04:00	[thread overview]
Message-ID: <taso0a5jmqopfukn0lkijgahc33k9t9e4h@4ax.com> (raw)
In-Reply-To: 4d9466ad-5c9e-4b1f-8797-def623b3beb6@googlegroups.com

On Sun, 7 Sep 2014 05:29:34 -0700 (PDT), Stribor40 <ikamzic@gmail.com>
declaimed the following:

>I have this program from online tutorial that says that tasks will run as soon as program starts. My question is when does this program starts on what line if code

http://www.adaic.org/resources/add_content/standards/05rm/html/RM-9-2.html

		<snip code>

>Do tasks run all at same tine or they are scheduled by OS which would mean anytime you run this program output would be different? 

	Maybe, maybe, maybe.

	(do tasks run ... same time) If you have a single CPU, tasks will
always need to be swapped by some mechanism; on a multi-core processor it
is possible that tasks could be assigned to each core and truly run in
parallel.

	(scheduled by OS) Depends upon the run-time system of the Ada
environment. Most common compilers defer to the OS for tasking (creating OS
level threads or processes for each Ada task); however a bare-board
environment may require the Ada run-time to implement the tasking model
internally (along with all I/O, etc.). The compilers meant to run on common
hardware (that is, desktop/laptop general purpose computers vs embedded
systems) defer to the OS as, if they implemented Ada tasking internally,
their internal scheduler would be blocked whenever any task performed a
blocking operation at the OS level.

	(output would be different) Possibly -- depending on what other
activities are taking place on the machine. The activation of the tasks
would be in the same order, and relative timings should hold BUT, if
something of higher priority (say an interrupt triggered by a network
packet) comes in, that could result in the activation/run of one task being
suspended, and with all tasks at the same priority, it is possible that the
OS will schedule the next task to resume rather than return to the first
one suspended (depends on how the scheduler operates -- if it grants a
fixed amount of time to a task, regardless of intervening interruptions, it
is likely to return to that task to complete the time allocation; or it
just puts any suspended task at the end of the chain of equal priority
tasks and picks up the new head task on resumption).

-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/


  reply	other threads:[~2014-09-07 15:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-07 12:29 Concurrency in Ada Stribor40
2014-09-07 15:05 ` Dennis Lee Bieber [this message]
2014-09-07 18:06 ` Jeffrey Carter
  -- strict thread matches above, loose matches on Subject: below --
1996-12-03  0:00 Javier Crespo
1996-12-03  0:00 ` Michael Feldman
1996-12-03  0:00 ` Greg Bond
1996-12-18  0:00 ` elaine.waybright
replies disabled

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