Topics and semaphores in Ada95

How to use streams in Ada95? What functions can I use to create, destroy, stop and start them?

How to use semaphores in this language?

+3
source share
3 answers

Ada terminology for a stream is a "task". Ada does not have semaphores (as such) embedded directly in the language, but Googling for something like the “Ada semaphore” should appear in a lot of hits. AdaPower.com , in particular, talks a lot about parallel programming in Ada (and, for that matter, almost all kinds of programming in Ada).

+3
source

Concurrency , Ada ( ) ( , // ). ( ) ​​ Ada, , C/Java.

Ada, ( , , ).

. ( ) ...

task My_Task;

task body My_Task is
begin
   -- Just print this to stdout and exit thread
   Ada.Text_IO.Put_Line("Hello, concurrent World!");
end;

...

task type My_Task_Type(N : Natural);

task body My_Task_Type(N : Natural) is ...

...

T1 := new My_Task_Type(100);

abort T1;

, ( )! . "" "" , , Ada.Synchronous_Task_Control.

+11

"" (, ), 2 ( .adb .ads), 3 (. " Ada" Alan Burns ). Ada , .

Ada ! http://3chevrons.blogspot.com/2010/02/semaphores-in-ada.html

, Ada concurrency C / Python. .

+3

Source: https://habr.com/ru/post/1728478/


All Articles