CS 32111NATIONAL UNIVERSITY OF SINGAPORESCHOOL OF COMPUTINGMidterm EXAMINATION FORSemester 2, 2009/2010CS 3211 - PARALLEL and CONCURRENT PROGRAMMINGMarch 2010Time Allowed: 1 hour 15 minutesINSTRUCTIONS TO CANDIDATES1. AnswerALLquestions in the space provided in this booklet.2. All answers should come with the correct justifications, there is no credit for guessing.3. This is anOPEN BOOKexamination.4.Please write your Matriculation Number below.MATRICULATION NO.:(This portion is reserved for the examiner’s use only)QuestionMarksRemarkQuestion A2Question B2Question C2Question D3Question E3Question F2Question G3Question H3Total20

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

CS 32112A. Define a processDuplicatewhich takes a value 0..9 as input, and outputs two copies of the value. Useprocess equations to define the process.[2 marks]

CS 32113B. Consider a lock process defined via a process equationLock = acquire -> release -> Lock.Processes using the lock will synchronize with it using theacquireandreleaseactions. Extend the abovedefinition to define a lock process which can be acquired by the same process more than once, just likethe recursive locking mechanism in Java which was taught in class.

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

What students are saying

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.

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

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.

Dana
University of Pennsylvania ‘17, Course Hero Intern

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.