Concurrent programming you should know the difference

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Concurrent Programming . You should know the difference between coroutines and tasks and the three methods of task synchronization - semaphores, monitors, and message passing. The Ada tasking model and Java thread model of concurrency were also briefly discussed.
Image of page 1

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

View Full Document Right Arrow Icon
CS 401/501 FINAL EXAM SAMPLE QUESTIONS 1. Fill in the Blank. A(n) is a situation where two tasks A and B each need two shared resources X and Y in order to complete their work, but A holds resource X and B holds resource Y, and each task must wait for the other to release the resource in order to continue. 2. A(n) is a condition which is true upon entry to a loop every time the loop is entered, and is still true at the termination of the loop. 3. True or False. A virtual method table is needed only for the execution of polymorphic functions in C++, but is not needed in Java. 4. List and briefly describe four (4) components of an activation record. 5. Consider the axioms of assignment, composition, and loop below: Assignment { P [E/V] } V := E { P } Composition { P } S 1 { Q } , { Q } S 2 { R } { P } S 1 ; S 2 { R } Loop { P&B } S { P } { P } while B loop S end loop { P& ¬ B } Prove the correctness of the following program segment. { n = j × (j + 1) / 2 & i 0 } while j != i loop j := j + 1; n := n + j; end loop { n = j × (j + 1) / 2 & i 0 & ¬ (j negationslash = i) } Show all steps used in the proof. 6. Consider the Pascal array declaration: A : array [ 10 .. 10, 5 .. 5, 1 .. 10] of T; Assuming that T requires 10 bytes of storage and A is stored at relative location 100, what is the relative location of A [1, 1, 2]?
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the 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