Concurrent Object-Oriented Programming
1 / 1

SCOOP : S imple C oncurrent O bject- O riented P rogramming - PowerPoint PPT Presentation

  • Uploaded on

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

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'SCOOP : S imple C oncurrent O bject- O riented P rogramming' - lyre

An Image/Link below is provided (as is) to download presentation

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Scoop s imple c oncurrent o bject o riented p rogramming

Concurrent Object-Oriented Programming SCOOP

Volkan Arslan, Bertrand Meyer, Piotr Nienaltowski

Chair of Software Engineering, ETH Zurich, Switzerland

Example: Bounded Buffers



  • separate class BOUNDED_BUFFER [G]

  • inherit


  • end

  • To use a call such asq.remove (where q: BOUNDED_BUFFER [G]), you must enclose it in a routine using q as formal argument.

  • It may be useful to provide a class BUFFER_ACCESSthat fully encapsulates the notion of bounded buffer.

  • indexing

  • description: “Encapsulation of access to bounded buffers"

  • classBUFFER_ACCESS [G]

  • put(q: BOUNDED_BUFFER [G]; x: G)is

  • -- Insert x into q, waiting if necessary until there is room.

  • require

  • not q.full

  • do

  • q.put (x)

  • ensure

  • not q.empty

  • end

  • remove(q: BOUNDED_BUFFER [G]) is

  • -- Remove an element from q, waiting if necessary

  • -- until there is such an element.

  • require

  • not q.empty

  • do

  • q.remove

  • ensure

  • not q.full

  • end

  • item(q: BOUNDED_BUFFER [G]): G is

  • -- Oldest element not yet consumed

  • require

  • not q.empty

  • do

  • Result:= q.item

  • ensure

  • not q.full

  • end

  • end -- BUFFER_ACCESS [G]


Reserving an object

  • SCOOP: Simple Concurrent Object-OrientedProgramming

  • Extend the pure, strongly typed, object-orientedlanguage Eiffel with a general and powerful concurrencyand distribution model.

  • SCOOP goals:

  • Minimality of mechanism (onlyonenew keyword)

  • Full use of inheritance and other object-oriented techniques

  • Compatibility with Design By Contract

  • Provability

  • Support for command-query distinction

  • Applicability to many forms of concurrency

  • Adaptability through libraries

  • Support for reuse of non-concurrent software

  • Support for deadlock avoidance



put (q: separate BOUNDED_QUEUE [G]; x: G) is

-- Insert x into q, waiting if necessary until there is room.


not q.full


q.put (x)


not q.empty



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

  • to use certain processors

  • to apply certain actions

  • to certain objects.

Definition: processor

A processor is an autonomous thread of control capable of supporting the sequential execution of instructions on one or more objects.

Separate Entities

Wait by necessity

Need to declare whether client processor is the same as

supplier processor or another.

x: separateCLASS_X

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


t.p (...)


k := t.some_value


Concurrency variants

  • Multiprocessing

  • Client server computing

  • Multitasking, multiprogramming

  • Intra-application concurrency (concurrency within an application)

  • Object Request Brokers (ORB)

  • Remote execution (e.g. through the WWW)

  • (Hard) real-time and embedded systems

Processor assignment


Simple notation: Concurrency Control File (CCF)


proc1: (2), (5), ...

proc2: (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.

SCOOP architecture


  • Two-level architecture:

  • First layer: Platform independent

  • Second layer: Platform dependent

  • Systematic approach to deadlock prevention

  • Precise fairness policies

  • Proof rules, actual proofs