prelim1sp06solutions - Name CS 414 Prelim 1 Solutions Netid...

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

View Full Document Right Arrow Icon
Name: Netid: CS 414 Prelim 1 Solutions This exam is closed book. You have 50 minutes to answer all questions. Show your work for partial credit. 1. Answer TRUE or FALSE (1 point for a correct answer, -0.5 for an incorrect answer) [9] (a) During a DMA transfer of data between device and memory, an interrupt requiring OS intervention will typically occur once for every 16 bytes transferred. F DMA interrupts after transfering a block of data and blocks are much larger than 16 bytes. (b) When running two or more multi-threaded applications on a multi-processor, the highest perfor- mance requires dedicating one CPU for each active user-level thread. Assume that the number of CPUs is C , and that each of the applications has T or fewer current concurrent threads, and that T < = C < 2 * T . T Threads switching between CPUs suffer a lot more cache misses. (c) Studies show that application developers make fewer programming errors when using monitors than when using semaphores. T Monitors were designed to tolerate programming errors. For example additional calls to signal (V()) on semaphore could lead to errors while additional calls to signal on monitors do not. (d) User-mode system call trap instructions should interrupt at a higher priority than the hardware clock. F Quotas can’t be ensured, the user-mode program could take control of the CPU by repeatedly calling system calls. (e) “Return from interrupt” can be allowed in user mode. F Return from interrupt involves updating the program counter. (f) An OS running on a virtual machine monitor will not get interrupts, hence interrupt handler code will never be executed. F The virtual machine monitor reflects the hardware interrupts to the OS. (g) In the “Bakery” mutual exclusion algorithm, the choosing array is used to ensure that if two threads simultaneously try to take a “ticket”, one will wait until the other has completed the ticket-taking code.
Image of page 1

Info iconThis 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.

{[ 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