1 / 7

Path Expressions

Path Expressions. a declarative specification of the synchronization desired among... a set of procedures that may be executed concurrently where... automatic enforcement of the synchronization is provided by automatically generated code that uses (an extended form of) semaphores. .

tucker
Download Presentation

Path Expressions

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Path Expressions • a declarative specification of the synchronization desired among... • a set of procedures that may be executed concurrently where... • automatic enforcement of the synchronization is provided by automatically generated code that uses (an extended form of) semaphores. With declarative approaches there is usually a tradeoff between the power of the expressions (i.e., the class of problems to which a solution can be expressed) and the feasibility of the expressions (i.e., the extent to which the expression can be translated into an (efficient) implementation). CS 5204 Fall 00

  2. Path Expression prologue prologue P1 Pn epilogue epilogue translator General Scheme CS 5204 Fall 00

  3. General Form • The general form of a path expression is: • path <exp> , <exp> , ... , <exp> end • where <exp> is an expression formed from the following • operators: • sequencer: x ; y • synchronizes the beginning of y • with the completion of x • restrictor: n:( x ) • limits to n the number of concurrent • invocations of x • derestrictor: [ x ] • allows an unlimited number of • concurrent invocations of x • grouping: ( ... ) • to express precedence or nesting CS 5204 Fall 00

  4. Examples • sequencing path put; get end The get procedure cannot begin its ith invocation until the put procedure has completed its ith invocation. No synchronization is implied about concurrent executions of put or concurrent executions of get. • restriction: mutual exclusion path 1:( write ) end only 1 procedure at a time can execute the procedure write. • restriction: mutual exclusive choice path 1:( write, read ) end the procedures write and read cannot both be executing concurrently CS 5204 Fall 00

  5. Examples • restriction: limited concurrency path 10:( read ) end up to 10 invocations of the read procedure can be in progress concurrently • simple readers­writers path 1: ( write , [ read ] ) end Either exactly one write procedure is executed or an unbounded number of concurrent executions of read CS 5204 Fall 00

  6. mutual exclusion of put and get path 1: ( put , get ) , n: ( put ; get ) end buffer overflow buffer underflow Examples • The producer­consumer problem for a buffer of size n has three constraints that can be stated in a single path expression: CS 5204 Fall 00

  7. path 1: ( put , get ) , n: ( put ; get ) end n: ( put ; get ) 1: ( put , get ) P(S2) put ; get V(S2) P(S1) put , get V(S1) P(S2) put V(S3) P(S3) get V(S2) P(S1) put V(S1) P(S1) get V(S1) P(S2) P(S1) put V(S3) V(S1) P(S3) P(S1) get V(S2) V(S1) semaphore S1 initially 1; semaphore S2 initially n; semaphore S3 initially 0; Translating Path Expressions CS 5204 Fall 00

More Related