8. Task
همروندی سازی پیاده اصلی عنصر
بود خواهد تعلیق حالت در یا اجرا حالت در.
کار یا وظیفه
اصلی اجزای
معرفی(Specification)
اصلی بدنه( Body )
ديگر براي اطالعاتTaskها
سازي پياده جزئيات
task type T is
Somethings…
end T;
task body T is
begin
Somethings…
end;
9. Entry ورودیه
يك در دسترسي قابل نهاد تنهاTask
خروجي و ورودي پارامترهاي با روال شبيه
شناسه يك با يكتا
task type T is
entry Put (data : in Integer);
entry Get (result : out Integer);
end T;
12. Protected Modules (cntd) ادامه...
protected type Protected_Buffer_Type is
entry Insert (An_Item : in Item);
entry Remove (An_Item : out Item);
private
Buffer : Item;
Empty : Boolean := True;
end Protected_Buffer_Type;
...
protected body Protected_Buffer_Type is
entry Insert (An_Item : in Item)
when Empty is
begin
Buffer := An_Item;
Empty := False;
end Insert;
entry Remove (An_Item : out Item)
when not Empty is
begin
An_Item := Buffer;
Empty := True;
end Remove;
end Protected_Buffer_Type;
Guard : دسترسي شرط
Protected entries
13. Mechanism مکانیزم
task type myTask is
entry put(data : integer);
entry get(result: integer);
end myTask;
task body myTask is
myData : integer;
begin
-- other statement
accept put(x : integer) do
-- other statements
end put;
-- other statements
end;
task به دسترسي هاي راه