160 likes | 374 Views
SCOOP it up!. Piotr Nienaltowski Chair of Software Engineering, ETH Zurich, Switzerland joint work with Volkan Arslan and Bertrand Meyer ETH Zurich. Motivation. Extend a pure, strongly typed, object-oriented language (Eiffel, …) with a simple , general and powerful concurrency model
E N D
SCOOP it up! Piotr Nienaltowski Chair of Software Engineering, ETH Zurich, Switzerland joint work with Volkan Arslan and Bertrand Meyer ETH Zurich PPoPP 2003, 13.06.2003, San Diego
Motivation • Extend a pure, strongly typed, object-oriented language (Eiffel, …) with a simple, general and powerful concurrencymodel • Provide the IT industry with a simple and powerful model for parallel programming • Make programmers sleep better! • Let them forget about all the nightmares of parallel programming and make their lives easier PPoPP 2003, 13.06.2003, San Diego
The SCOOP model • Simple Concurrent Object-Oriented Programming • High-level concurrency mechanism • Full use of inheritance and other object-oriented techniques • Applicable to many physical setups: multiprocessing, multithreading, distributed execution, etc. • Based on Design by Contract PPoPP 2003, 13.06.2003, San Diego
Object-oriented computation To perform a computation is • to use certain processors • to apply certain actions • to certain objects. PPoPP 2003, 13.06.2003, San Diego
What makes an application concurrent? Processor: autonomous thread of control supporting sequential execution of instructions on one or more objects Can be implemented as: • CPU • Process • Thread • AppDomain (.NET) … PPoPP 2003, 13.06.2003, San Diego
Feature call (synchronous) • Fundamental scheme of O-O computation: feature call x.f (a) • x:CLASS_X PPoPP 2003, 13.06.2003, San Diego
Separate feature call (asynchronous) • Fundamental scheme of O-O computation: feature call x.f (a) • x:separateCLASS_X PPoPP 2003, 13.06.2003, San Diego
Access control policy • Target of a separate call must be a formal argument of the enclosing routine: store (buffer:separate BUFFER; value: INTEGER)is -- Store value into buffer. do buffer.put (value) end • To obtain exclusive access to a separate object, use it as argument of the call: store (my_buffer, 10) PPoPP 2003, 13.06.2003, San Diego
From preconditions to wait-conditions Contracts in Eiffel store (buffer: BUFFER; value: INTEGER)is -- Store value into buffer. require not buffer.is_full value > 0 do buffer.put (value) ensure notbuffer.is_empty end ... store (my_buffer, 10) • If b is separate, precondition becomes wait condition (instead of correctness condition) PPoPP 2003, 13.06.2003, San Diego
From preconditions to wait-conditions Contracts in Eiffel store (buffer:separate BUFFER; value: INTEGER)is -- Store value into buffer. require not buffer.is_full value > 0 do buffer.put (value) ensure notbuffer.is_empty end ... store (my_buffer, 10) • If buffer is separate, precondition becomes wait condition. PPoPP 2003, 13.06.2003, San Diego
Synchronization • No special mechanism needed for client to resynchronize with supplier after separate call. • The client will wait only when it needs to: x.f x.g (a) y.f … value := x.some_query PPoPP 2003, 13.06.2003, San Diego
Synchronization • No special mechanism needed for client to resynchronize with supplier after separate call. • The client will wait only when it needs to: x.f x.g (a) y.f … value := x.some_query • This mechanism is called wait by necessity. PPoPP 2003, 13.06.2003, San Diego
SCOOP platform-independent .NET Compact Framework .NET POSIXThreads … Two-level architecture of SCOOP • SCOOP can be implemented in several environments • Microsoft .NET is our current platform PPoPP 2003, 13.06.2003, San Diego
Future work • Extension of access control policy • multiple locking of separate objects based on the concept of pure functions • Instruction-level parallelism • Deadlock prevention • Extending SCOOP for real-time systems • duel mechanism with priorities • timing assertions PPoPP 2003, 13.06.2003, San Diego
Conclusion SCOOP model is simple yet powerful • Full concurrency support • Full use of object-oriented techniques • Just one new keywordseparate • Based on Design by Contract • Several platforms and architectures PPoPP 2003, 13.06.2003, San Diego
Scoop it up! PostDoc and RA/PhD positions available At the Chair of Software Engineering, ETH Zurich, lead by Bertrand Meyer • SCOOP project (PostDoc/RA) • Formal methods for O-O programming (RA) http://se.inf.ethz.ch PPoPP 2003, 13.06.2003, San Diego