Concurrent Object-Oriented Programming SCOOP. Volkan Arslan, Bertrand Meyer, Piotr Nienaltowski Chair of Software Engineering, ETH Zurich, Switzerland. Example: Bounded Buffers. Goal. Method. separate class BOUNDED_BUFFER [ G ] inherit BOUNDED_QUEUE [ G ] end
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
Volkan Arslan, Bertrand Meyer, Piotr Nienaltowski
Chair of Software Engineering, ETH Zurich, Switzerland
Example: Bounded Buffers
Reserving an object
class BUFFER_ACCESS [G]
put (q: separate BOUNDED_QUEUE [G]; x: G) is
-- Insert x into q, waiting if necessary until there is room.
The call put (q, a_value) will block until:
• q is available.
• the precondition not q.full is true.
A precondition applying to a separate argument will be a
wait condition instead of a correctness condition.
To perform a computation is
A processor is an autonomous thread of control capable of supporting the sequential execution of instructions on one or more objects.
Wait by necessity
Need to declare whether client processor is the same as
supplier processor or another.
Once a separate call has started, a client only needs
to wait for its termination if the call is to a query.
r (..., t: separate SOME_TYPE, ...) is
k := t.some_value
Simple notation: Concurrency Control File (CCF)
proc1: sales.microsoft.com (2),
coffees.whitehouse.gov (5), ...
proc2: 188.8.131.52 (1), ...
Physical resources may be Internet nodes, threads, Unix or Windows processes, etc.
The attempt to snatch a shared object from its current
Request immediate service: immediate_service
Accept immediate service: yield
Dual semantics of a call:
If Object 1 and Object 2 have the same processor, any
further operation on Object 1 (next_instruction) must wait
until the call terminates. Such calls are said to be
If Object 1 and Object 2 are handled by different
processors, operation on Object 1 can proceed as soon
as it has initiated the call on Object 2. Such calls are said
to be asynchronous.