© Thomas Kunz 2000
SCE 574
199
Language with Support for Concurrency: Ada
äExplicit language support for concurrency
äHas a programming construct named a task
äEach task is a thread with its own stack
äTasks are objects with methods named entries
äTask Stack is
äEntry Init(....);
äEntry Push(...);
äEntry Pop(...);
äEnd Stack;
äTask body Stack is
äBegin
ä Loop
ä Select
ä accept Init(....) do ......
ä End Init;
ä or
ä accept Push(...) do .....
ä End Push;
ä ....
ä End select;
ä     Other work....
ä End Loop
äEnd Stack;
Task chooses which
entries it will accept
calls from
When Ada code is compiled
these language keywords such
as accept, and the rendezvous to
entries are replaced with subprogram
calls to the Ada runtime. The
result is a threaded application described
using the Ada language