automatic realizations of statically safe intra object
play

Automatic Realizations of Statically Safe Intra-Object - PowerPoint PPT Presentation

Motivation Basic Definitions MP-Eiffel Brief Presentation Intra-Object Synchronization Inter-Object Synchronization Other Issues Automatic Realizations of Statically Safe Intra-Object Synchronization Schemes in MP-Eiffel Miguel Oliveira e


  1. Motivation Basic Definitions MP-Eiffel Brief Presentation Intra-Object Synchronization Inter-Object Synchronization Other Issues Automatic Realizations of Statically Safe Intra-Object Synchronization Schemes in MP-Eiffel Miguel Oliveira e Silva (mos@det.ua.pt) IEETA - Department of Electronics, Telecommunications, and Informatics University of Aveiro First International Symposium on Concurrency, Real-Time and Distribution in Eiffel-like Languages, 2006 CORDIE 2006, July, York, UK Synchronization in MP-Eiffel

  2. Motivation Basic Definitions MP-Eiffel Brief Presentation Intra-Object Synchronization Inter-Object Synchronization Other Issues Outline Motivation 1 Basic Definitions 2 MP-Eiffel Brief Presentation 3 Intra-Object Synchronization 4 Inter-Object Synchronization 5 Other Issues 6 CORDIE 2006, July, York, UK Synchronization in MP-Eiffel

  3. Motivation Basic Definitions MP-Eiffel Brief Presentation Why an alternative approach to SCOOP? Intra-Object Synchronization Inter-Object Synchronization Other Issues Why an Alternative Approach to SCOOP? Provide both models of inter-processor communication: x.f(y) Shared memory (Current = processor(x)) Message passing (Current /= processor(x)) Intra-object concurrency Concurrent contracts Avoid redundancy within concurrent calls (wrapper routines with duplicated preconditions) Interesting and fun work for a PhD CORDIE 2006, July, York, UK Synchronization in MP-Eiffel

  4. Motivation Basic Definitions MP-Eiffel Brief Presentation Intra-Object Synchronization Inter-Object Synchronization Other Issues Basic Definitions Processor (Writer, Reader) Concurrent objects Synchronization requirements: Intra-object synchronization (server synchronization) Conditional synchronization Inter-object synchronization (client synchronization) Concurrent condition Concurrent assertion Concurrent object availability COA x = N c N x x: readers/writers/all, c: maximum concurrent processors CORDIE 2006, July, York, UK Synchronization in MP-Eiffel

  5. Motivation Basic Definitions General properties MP-Eiffel Brief Presentation Shared memory inter-processor communication Intra-Object Synchronization Message Passing Inter-Processor Communication Inter-Object Synchronization Processor Life Cycle Other Issues MP-Eiffel Explicit concurrent objects Static safety Abstract processors Both models of inter-processor communication Abstract synchronization Concurrency control language CORDIE 2006, July, York, UK Synchronization in MP-Eiffel

  6. Motivation Basic Definitions General properties MP-Eiffel Brief Presentation Shared memory inter-processor communication Intra-Object Synchronization Message Passing Inter-Processor Communication Inter-Object Synchronization Processor Life Cycle Other Issues Shared Memory Inter-Processor Communication shared and remote objects shared entities: job_queue: shared QUEUE[JOB] remote entities: weather: remote WEATHER Identify pure query services attributes functions without assignments to attributes and calls to impure routines. all possible redefinitions are also required to be pure Synchronous exceptions (same processor) CORDIE 2006, July, York, UK Synchronization in MP-Eiffel

  7. Motivation Basic Definitions General properties MP-Eiffel Brief Presentation Shared memory inter-processor communication Intra-Object Synchronization Message Passing Inter-Processor Communication Inter-Object Synchronization Processor Life Cycle Other Issues Message Passing Inter-Processor Communication triggers message sender: trigger x.f x is required to be a remote entity message receiver: explicit trigger interface trigger {A_CLASS} a,b,c Synchronous sequential preconditions CORDIE 2006, July, York, UK Synchronization in MP-Eiffel

  8. Motivation Basic Definitions General properties MP-Eiffel Brief Presentation Shared memory inter-processor communication Intra-Object Synchronization Message Passing Inter-Processor Communication Inter-Object Synchronization Processor Life Cycle Other Issues Processor Life Cycle Created by a create call on a remote entity NO START EXECUTE CREATION TRIGGER? END YES TRIGGER FINISH EXECUTE TRIGGER WAIT CORDIE 2006, July, York, UK Synchronization in MP-Eiffel

  9. Motivation Concurrent Object Correctness Basic Definitions Monitor MP-Eiffel Brief Presentation Readers-Writer Exclusion Intra-Object Synchronization Concurrent Readers-Writer Inter-Object Synchronization Lock-free and software transactional memory Other Issues Mixed synchronization schemes Concurrent Object Correctness Abstract Data Type Stable times client usage ensure sequential correctness Public modifiable attributes forbidden Linearizability (Herlihy, 1990) Class contracts Total object covering Processor attributes (not yet adopted) CORDIE 2006, July, York, UK Synchronization in MP-Eiffel

  10. Motivation Concurrent Object Correctness Basic Definitions Monitor MP-Eiffel Brief Presentation Readers-Writer Exclusion Intra-Object Synchronization Concurrent Readers-Writer Inter-Object Synchronization Lock-free and software transactional memory Other Issues Mixed synchronization schemes Concurrent Contracts Correct behavior? if not C then raise exception end (1) reserve OBJs do if not C then (2) assert C end raise exception end end (3) wait C end CORDIE 2006, July, York, UK Synchronization in MP-Eiffel

  11. Motivation Concurrent Object Correctness Basic Definitions Monitor MP-Eiffel Brief Presentation Readers-Writer Exclusion Intra-Object Synchronization Concurrent Readers-Writer Inter-Object Synchronization Lock-free and software transactional memory Other Issues Mixed synchronization schemes Monitor Object Simplest synchronization scheme P 1 . Lowest concurrent availability P i . . i ∈ { 1 , . . . , n } P n Requirements: : Monitor : Processor Public service identification COA P = 1 n CORDIE 2006, July, York, UK Synchronization in MP-Eiffel

  12. Motivation Concurrent Object Correctness Basic Definitions Monitor MP-Eiffel Brief Presentation Readers-Writer Exclusion Intra-Object Synchronization Concurrent Readers-Writer Inter-Object Synchronization Lock-free and software transactional memory Other Issues Mixed synchronization schemes Readers-Writer Exclusion Object Object R 1 R 1 Taking advantage of . . . . command/query separation . R 1 . R p R p . W i . W 1 . W 1 R p Requirements: . . . . . . W q W q Query (pure) services identification COA R = 100 % , COA W = 0 % COA R = 0 % , COA W = 1 q CORDIE 2006, July, York, UK Synchronization in MP-Eiffel

  13. Motivation Concurrent Object Correctness Basic Definitions Monitor MP-Eiffel Brief Presentation Readers-Writer Exclusion Intra-Object Synchronization Concurrent Readers-Writer Inter-Object Synchronization Lock-free and software transactional memory Other Issues Mixed synchronization schemes Concurrent Readers-Writer Object R 1 Similar requirements as . R 1 . readers-writer exclusion . . R p . Starvation of readers is possible . i ∈ { 1 , . . . , q } R p W 1 Wait-free algorithm (Peterson) for . W i : Concurrent . objects with a unique writer . Readers-Writer W q (concurrent objects attached to : Processor remote entities) Repeatable pure queries COA R = 100 % COA W = 1 q CORDIE 2006, July, York, UK Synchronization in MP-Eiffel

  14. Motivation Concurrent Object Correctness Basic Definitions Monitor MP-Eiffel Brief Presentation Readers-Writer Exclusion Intra-Object Synchronization Concurrent Readers-Writer Inter-Object Synchronization Lock-free and software transactional memory Other Issues Mixed synchronization schemes Lock-Free and Software Transactional Memory Object R 1 R 1 No blocking . . . . Immune to deadlocks and . . R p R p processor failure W 1 W 1 Complex schemes . . . . . . : Lock-Free Requirements: W q W q : Processor Object state replication Repeatable services COA R = 100 % COA W = 100 % CORDIE 2006, July, York, UK Synchronization in MP-Eiffel

  15. Motivation Concurrent Object Correctness Basic Definitions Monitor MP-Eiffel Brief Presentation Readers-Writer Exclusion Intra-Object Synchronization Concurrent Readers-Writer Inter-Object Synchronization Lock-free and software transactional memory Other Issues Mixed synchronization schemes Mixed Exclusion Schemes Object R 1 Mutual exclusion between schemes . . . Solves the problem of intra-object A R p and inter-object object W 1 synchronization integration . B : . Concurrent . Requirements: Readers-Writer (A) W q Total object covering : Lock-Free (B) Safety of each scheme COA A = COA CRW COA B = COA LF CORDIE 2006, July, York, UK Synchronization in MP-Eiffel

  16. Motivation Concurrent Object Correctness Basic Definitions Monitor MP-Eiffel Brief Presentation Readers-Writer Exclusion Intra-Object Synchronization Concurrent Readers-Writer Inter-Object Synchronization Lock-free and software transactional memory Other Issues Mixed synchronization schemes Mixed Concurrent Schemes Object R 1 Unsafe in general . . A . C : Concurrent R p It may apply if concurrent services : Exclusion handle don’t use the same W 1 X C Readers-Writer attributes. However, . . Features in A and B . W q B can run concurrently linearizable invariant verification is Features in X require required! exclusion CORDIE 2006, July, York, UK Synchronization in MP-Eiffel

Recommend


More recommend