comp.lang.ada
 help / color / mirror / Atom feed
* Concurrency in Ada
@ 1996-12-03  0:00 Javier Crespo
  1996-12-03  0:00 ` Greg Bond
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Javier Crespo @ 1996-12-03  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 555 bytes --]


Hello All:

I�m a graduate student who needs to know more about the concurrent features
in ADA 95 for a proyect work (we study Ada as CS1 in the degree, Physics).
I�ve consulted several sources including Alan Burns� "Concurrency in Ada",
but a would like to find a good full example of the use of concurrency in
Ada 95, as all the examples I have found in the net are for Ada 83. Could
anyone provide it to me, or tell me where could I find it?

	Thank you in advance
-- 
Javier Crespo (jcrespo@caminos.recol.es)
University of Cantabria, Spain





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Concurrency in Ada
  1996-12-03  0:00 Javier Crespo
@ 1996-12-03  0:00 ` Greg Bond
  1996-12-03  0:00 ` Michael Feldman
  1996-12-18  0:00 ` elaine.waybright
  2 siblings, 0 replies; 7+ messages in thread
From: Greg Bond @ 1996-12-03  0:00 UTC (permalink / raw)
  To: Javier Crespo


Javier Crespo wrote:
> 
> Hello All:
> 
> I�m a graduate student who needs to know more about the concurrent features
> in ADA 95 for a proyect work (we study Ada as CS1 in the degree, Physics).
> I�ve consulted several sources including Alan Burns� "Concurrency in Ada",
> but a would like to find a good full example of the use of concurrency in
> Ada 95, as all the examples I have found in the net are for Ada 83. Could
> anyone provide it to me, or tell me where could I find it?

The copy of "Concurrency in Ada" that I have (copyright 1995) uses only
Ada95 examples. Did you not find "full examples" there? What are you
looking for in particular?

--
* Greg Bond                         * Dept. of Electrical Eng.  
* email: bond@ee.ubc.ca             * Univ. of British Columbia      
* voice: (604) 822 0899             * 2356 Main Mall                 
* fax:   (604) 822 5949             * Vancouver, BC              
* web: http://www.ee.ubc.ca/~bond   * Canada, V6T 1Z4




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Concurrency in Ada
  1996-12-03  0:00 Javier Crespo
  1996-12-03  0:00 ` Greg Bond
@ 1996-12-03  0:00 ` Michael Feldman
  1996-12-18  0:00 ` elaine.waybright
  2 siblings, 0 replies; 7+ messages in thread
From: Michael Feldman @ 1996-12-03  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 597 bytes --]


In article <01bbe0f6$b0773680$LocalHost@jcrespo.rcp.es>,
Javier Crespo <jcrespo@caminos.recol.es> wrote:
>Hello All:
>
>I�m a graduate student who needs to know more about the concurrent features
>in ADA 95 for a proyect work (we study Ada as CS1 in the degree, Physics).
>I�ve consulted several sources including Alan Burns� "Concurrency in Ada"

You need the new (1995) book by Burns and Wellings, "Concurrency in
Ada". I think the one you mentioned is the old (1985) Ada 83 edition.
The citation for the new one is:
Cambridge University Press, 1995. ISBN 0-521-41471-7.

Mike Feldman




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Concurrency in Ada
  1996-12-03  0:00 Javier Crespo
  1996-12-03  0:00 ` Greg Bond
  1996-12-03  0:00 ` Michael Feldman
@ 1996-12-18  0:00 ` elaine.waybright
  2 siblings, 0 replies; 7+ messages in thread
From: elaine.waybright @ 1996-12-18  0:00 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 996 bytes --]



On 3 Dec 1996 08:58:11 GMT, "Javier Crespo" <jcrespo@caminos.recol.es>
wrote:

>Hello All:
>
>I�m a graduate student who needs to know more about the concurrent features
>in ADA 95 for a proyect work (we study Ada as CS1 in the degree, Physics).
>I�ve consulted several sources including Alan Burns� "Concurrency in Ada",
>but a would like to find a good full example of the use of concurrency in
>Ada 95, as all the examples I have found in the net are for Ada 83. Could
>anyone provide it to me, or tell me where could I find it?
>
>	Thank you in advance
>-- 
>Javier Crespo (jcrespo@caminos.recol.es)
>University of Cantabria, Spain
>
Check out the ASSET repository. Go to http://www.asset.com/ and click
on the link to the "Ada Courseware Collection". There are several
courses there, all of which are freely available. 

ASSET_A_825   'A course in real-time software design based on Ada 95"
contains several practical examples of concurrency in Ada 95.

Bo Sanden
Colorado Tech.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Concurrency in Ada
@ 2014-09-07 12:29 Stribor40
  2014-09-07 15:05 ` Dennis Lee Bieber
  2014-09-07 18:06 ` Jeffrey Carter
  0 siblings, 2 replies; 7+ messages in thread
From: Stribor40 @ 2014-09-07 12:29 UTC (permalink / raw)


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
WITH Ada.Text_IO;                  --  Include Text_IO Library
WITH Ada.Integer_Text_IO;          --  Include Integer Text_IO Library
PROCEDURE task_demo_01 IS
                                   --  Task Type Specification
     TASK TYPE intro_task (message : Integer);

     TASK BODY intro_task IS       --  Task Body Definition
     BEGIN
          FOR count IN 1..5 LOOP
               Ada.Text_IO.put (Item => "Display from Task ");
               Ada.Integer_Text_IO.put (Item => message, Width => 1);
               Ada.Text_IO.new_line;
          END LOOP;
     END intro_task;
     --  Unlike procedures, these tasks are not called.
     --  These three tasks are activated once the program begins.
     Task_1 : intro_task (message => 1);
     Task_2 : intro_task (message => 2);
     Task_3 : intro_task (message => 3);
BEGIN                                           
     NULL;                                   
END task_demo_01;

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? 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Concurrency in Ada
  2014-09-07 12:29 Concurrency in Ada Stribor40
@ 2014-09-07 15:05 ` Dennis Lee Bieber
  2014-09-07 18:06 ` Jeffrey Carter
  1 sibling, 0 replies; 7+ messages in thread
From: Dennis Lee Bieber @ 2014-09-07 15:05 UTC (permalink / raw)


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/


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Concurrency in Ada
  2014-09-07 12:29 Concurrency in Ada Stribor40
  2014-09-07 15:05 ` Dennis Lee Bieber
@ 2014-09-07 18:06 ` Jeffrey Carter
  1 sibling, 0 replies; 7+ messages in thread
From: Jeffrey Carter @ 2014-09-07 18:06 UTC (permalink / raw)


On 09/07/2014 05:29 AM, Stribor40 wrote:
> 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

I'm not sure what you're asking. In Ada the declarations (before "begin") are
elaborated at run time, followed by execution of the statements after "begin".
Task objects such as in the example begin executing when elaboration/execution
reaches "begin".

> 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?

Conceptually, tasks run at the same time. What actually happens depends on the
OS (if any) and number of processors available. In general, the externally
observable effects of multiple tasks will differ from run to run unless the
program takes steps to ensure otherwise. See a recent thread here on c.l.a on
interleaved output from tasks.

-- 
Jeff Carter
"It's symbolic of his struggle against reality."
Monty Python's Life of Brian
78


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-09-07 18:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-07 12:29 Concurrency in Ada Stribor40
2014-09-07 15:05 ` Dennis Lee Bieber
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 ` Greg Bond
1996-12-03  0:00 ` Michael Feldman
1996-12-18  0:00 ` elaine.waybright

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