Resources can be encapsulated and accessed only through a high-level interface (a package in Ada).
In Ada - If the resource manager is a server then the package body will contain a task (or an access object to a task type). A protected resource will use a protected object within the package body.
In Java - protected resources are naturally encapsulated within a monitor.
The ‘information’ needed to express synchronisation constraints can be categorised:
Most synchronisation methods can cope with all of these, though parameters cause problems, apparently.
There are (generally) two approaches to constraining access to a service.
The Requeue facility in Ada enhances the usability of avoidance synchronisation. It moves the task (which has been through one guard or barrier) to beyond another guard.
Ada permits:
The main use is to send the calling task to a different entry of the same unit.
Requeue is not just an entry call; if an entry call is ‘requeue’ then the call is completed - anything after the requeue Entry_Name will not be executed.
You can requeue tasks across different objects so long as they are type conferment.
This might require looking up in some Ada manual or giving it a try; the lecture slides make it sound more complex than it is and I missed the lecture.
Comments
blog comments powered by Disqus