SCOOP (software)

Last updated

SCOOP (Simple Concurrent Object Oriented Programming) is a concurrency model designed for the Eiffel programming language, conceived by Eiffel's creator and designer, Bertrand Meyer.

Contents

SCOOP defines a way for an object oriented program to be written without the concept of threads, locks, or other typical multiprogramming methods. This allows the compiler or runtime environment to optimize the amount of concurrency as well as eliminate typical design flaws such as deadlock.

The model was first designed in the early 1990s and published in 1993 in the Communications of the ACM [1] An updated version was described in chapter 30 of the book Object-Oriented Software Construction . [2] A prototype implementation was developed in 1995 by Eiffel Software. An article by Compton and Walker [3] provides an overview of SCOOP and describes another early implementation. Nienaltowski, Arslan and Meyer have published a description of the model as of 2003. [4] Work on SCOOP proceeded at the Chair of Software Engineering at ETH Zurich. [5] SCOOP became available as a standard part of EiffelStudio early in 2011. [6]

Technical overview

SCOOP works by allowing references to certain objects to be declared as separate. In the code below, an entity local_inventory is declared as a separate type, by specifying the Eiffel language keyword separate in the declaration.

local_inventory:separateINVENTORY

A separate object may be handled by a SCOOP processor that is different from the processor handling the referencing object. A SCOOP processor is the abstract notion of an autonomous thread of control that handles the execution of operations on one or more objects. SCOOP processors are independent of underlying concurrency mechanisms like processor threads, multiple processor cores, and distributed computer systems.

In addition to the concept of separateness, SCOOP exploits the principles of design by contract as part of the SCOOP strategy for synchronizing access to shared separate resources. For example, a precondition for a consumer wishing to access an item in the inventory example above, might be that such an item does currently exist. This would be expressed with a contract on the feature of class INVENTORY which returns the item.

item:PRODUCT-- Current itemrequireinventory_has_item:has_item

In traditional, sequential processing, a client intending to call local_inventory.item would be responsible for making certain that the precondition local_inventory.has_item holds before making the call. If the call to item were made in a state in which has_item did not hold, the caller would incur a precondition violation exception.

In the presence of SCOOP and given the separateness of local_inventory, making the check on has_item before calling item would not be reliable. This is because the state of local_inventory could have been changed by requests from other SCOOP processors between the time that the check was made and the time that item could be called.

As a result, when SCOOP is enabled, the precondition has_item is transformed from a correctness condition, which will cause an exception in the case of a violation, to a wait condition. The wait condition will cause the execution of item to be delayed until such time as has_item holds. In the Eiffel Software implementation, if SCOOP is not enabled, the separate keyword is ignored and sequential processing is assumed.

See also

Related Research Articles

Eiffel is an object-oriented programming language designed by Bertrand Meyer and Eiffel Software. Meyer conceived the language in 1985 with the goal of increasing the reliability of commercial software development; the first version becoming available in 1986. In 2005, Eiffel became an ISO-standardized language.

Design by contract approach for designing software

Design by contract (DbC), also known as contract programming, programming by contract and design-by-contract programming, is an approach for designing software.

In computer programming, a precondition is a condition or predicate that must always be true just prior to the execution of some section of code or before an operation in a formal specification.

In computer programming, a postcondition is a condition or predicate that must always be true just after the execution of some section of code or after an operation in a formal specification. Postconditions are sometimes tested using assertions within the code itself. Often, postconditions are simply included in the documentation of the affected section of code.

In computing and computer programming, exception handling is the process of responding to the occurrence of exceptions – anomalous or exceptional conditions requiring special processing - during the execution of a program. In general, an exception breaks the normal flow of execution and executes a pre-registered exception handler; the details of how this is done depend on whether it is a hardware or software exception and how the software exception is implemented. It is provided by specialized programming language constructs, hardware mechanisms like interrupts, or operating system (OS) inter-process communication (IPC) facilities like signals. Some exceptions, especially hardware ones, may be handled so gracefully that execution can resume where it was interrupted.

In concurrent programming, guarded suspension is a software design pattern for managing operations that require both a lock to be acquired and a precondition to be satisfied before the operation can be executed. The guarded suspension pattern is typically applied to method calls in object-oriented programs, and involves suspending the method call, and the calling thread, until the precondition is satisfied.

In software engineering, double-checked locking is a software design pattern used to reduce the overhead of acquiring a lock by testing the locking criterion before acquiring the lock. Locking occurs only if the locking criterion check indicates that locking is required.

Computer science is the study of the theoretical foundations of information and computation and their implementation and application in computer systems. One well known subject classification system for computer science is the ACM Computing Classification System devised by the Association for Computing Machinery.

Command–query separation (CQS) is a principle of imperative computer programming. It was devised by Bertrand Meyer as part of his pioneering work on the Eiffel programming language.

Bertrand Meyer French computer scientist

Bertrand Meyer is a French academic, author, and consultant in the field of computer languages. He created the Eiffel programming language and the idea of design by contract.

In computer science, message passing is a technique for invoking behavior on a computer. The invoking program sends a message to a process and relies on that process and its supporting infrastructure to select and then run the code it selects. Message passing differs from conventional programming where a process, subroutine, or function is directly invoked by name. Message passing is key to some models of concurrency and object-oriented programming.

In computer science, software transactional memory (STM) is a concurrency control mechanism analogous to database transactions for controlling access to shared memory in concurrent computing. It is an alternative to lock-based synchronization. STM is a strategy implemented in software, rather than as a hardware component. A transaction in this context occurs when a piece of code executes a series of reads and writes to shared memory. These reads and writes logically occur at a single instant in time; intermediate states are not visible to other (successful) transactions. The idea of providing hardware support for transactions originated in a 1986 paper by Tom Knight. The idea was popularized by Maurice Herlihy and J. Eliot B. Moss. In 1995 Nir Shavit and Dan Touitou extended this idea to software-only transactional memory (STM). Since 2005, STM has been the focus of intense research and support for practical implementations is growing.

Concurrent computing is a form of computing in which several computations are executed concurrently—during overlapping time periods—instead of sequentially, with one completing before the next starts.

Object-oriented analysis and design (OOAD) is a technical approach for analyzing and designing an application, system, or business by applying object-oriented programming, as well as using visual modeling throughout the software development process to guide stakeholder communication and product quality.

<i>Object-Oriented Software Construction</i> book by Bertrand Meyer

Object-Oriented Software Construction is a book by Bertrand Meyer, widely considered a foundational text of object-oriented programming. The first edition was published in 1988; the second, extensively revised and expanded edition, in 1997. Numerous translations are available including Dutch, French (1+2), German (1), Italian (1), Japanese (1+2), Persian (1), Polish (2), Romanian (1), Russian (2), Serbian (2), and Spanish (2). The book has been cited thousands of times in computer science literature. The book won a Jolt award in 1994.

The following outline is provided as an overview of and topical guide to computer programming:

The Journal of Object Technology is an online scientific journal covering object-oriented programming and component-based development. It is free for both readers and authors and published by the Chair of Software Engineering at the ETH Zurich. Its first issue appeared in May 2002, in response to the need for an international journal covering the object-oriented and component-based development field. From 1986 to 2001, the Journal of Object-Oriented Programming played much of that role, but after it was sold to a new owner in 2000, it was announced in the following year that it would cease publication at the end of the year. The launching of The Journal of Object Technology was largely a response to this event, as leaders from the community realized a flagship publication was needed.

EiffelStudio

EiffelStudio is a development environment for the Eiffel programming language developed and distributed by Eiffel Software.

Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which can contain data, in the form of fields, and code, in the form of procedures. A feature of objects is an object's procedures that can access and often modify the data fields of the object with which they are associated. In OOP, computer programs are designed by making them out of objects that interact with one another. OOP languages are diverse, but the most popular ones are class-based, meaning that objects are instances of classes, which also determine their types.

References

  1. Bertrand Meyer: Systematic Concurrent Object-Oriented Programming, in Communications of the ACM, 36, 9, September 1993, pp. 56-80, also available online.
  2. Bertrand Meyer: Object-Oriented Software Construction, 2nd edition, Prentice Hall, 1997
  3. Compton, Michael; Walker, Richard (2002). "A Run-time System for SCOOP". Journal of Object Technology. 1 (3): 119–157. doi: 10.5381/jot.2002.1.3.a8 .
  4. Nienaltowski, P.; Arslan, V.; Meyer, B. (2003). "Concurrent object-oriented programming on .NET" (PDF). IEE Proceedings - Software. 150 (5): 308. doi:10.1049/ip-sen:20030992.
  5. ETH Zurich, Chair of Software Engineering: SCOOP project page
  6. Eiffel Software: SCOOP: Concurrency for Eiffel