Assignment 2

Assignment 2 - Otherwise the process continues execution...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Assignment 2 Due Date 4 weeks (5 points) 1. Can any precedence graph may be implemented by fork/join construct? Proof? 2. Show by example that all precedence graphs cannot be implemented only by cobegin/coend construct. Characterize the precedence graphs those may be implemented using only cobegin/coend. 3. Write a program that will accept a precedence graph as input and generate the corresponding program using fork/join. Fork/join Fork: The fork system call for this assignment has one parameter, viz., a label. Fork creates an identical copy of the calling process, which begins execution at the label. Join: The join system call has one parameter, viz., an integer. Join decrements the integer by one. If the value of the integer after decrement is non-zero, the process terminates.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Otherwise the process continues execution with the next statement. Example: The fork/join implementation of a precedence graph is shown below. S 1 ; S S 1 count1:=2; fork L1; S 2 ; S 4 ; count2:=2; S 2 S 3 fork L2; S 5 ; Go to L3; L1: S 3 ; L2: join count1; S 4 S 6 S 6 ; L3: join count2; S 7 ; S 5 S 7 Cobegin/coend Cobegin/coend construct allows concurrent execution of all program blocks enclosed. At cobegin all program blocks begin concurrent execution and at coend all of them must complete execution before the next block may begin execution. Example: The cobegin/coend implementation of a precedence graph is shown below. S 1 begin S 1 ; cobegin S 3 ; begin S 2 ; S 2 S 3 cobegin S 4 ; S 5 ; coend; S 6 ; S 4 S 5 end; coend; S 7 ; end; S 6 S 7...
View Full Document

This note was uploaded on 01/25/2010 for the course CSC 7103 taught by Professor Kannan,r during the Fall '08 term at LSU.

Page1 / 2

Assignment 2 - Otherwise the process continues execution...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online