{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Assignment 2 - Otherwise the process continues execution...

Info icon This 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.
Image of page 1

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

View Full Document Right Arrow Icon
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern