cs241sp11hw2sol - CS 241, Homework #2, Spring 2011 NetID: _...

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

View Full Document Right Arrow Icon
CS 241, Homework #2, Spring 2011 NetID: _________________________ CS 241, Homework #2, Spring 2011 Name: ____ SOLUTION ____________________ ( and place your NetID on every sheet! ) INSTRUCTIONS : This homework is INDIVIDUAL WORK . Please TYPE your homework solutions. Handwritten solutions WILL NOT be graded. Please STAPLE all sheets together. And type your NetID on EVERY stapled sheet. Homework is due IN-CLASS, AT THE BEGINNING OF CLASS (11:00am) on Monday, February 28, 2011. Since solutions may be discussed during class, no late submissions are allowed. GRADING RUBRIC : Total /20 Grade: Grader: 1. (1 Point) Of the scheduling policies listed below, what policy will have the shortest average initial waiting time after many jobs are queued and ran to completion? a. First Come First Serve (FCFS) b. Priority (PRI) c. Preemptive Priority (PPRI) d. Round Robin with a quantum of much less than the shortest job (RR) 2. (1 Point) Which of the following scheduling algorithms will ALWAYS behave the same as First Come First Serve (FCFS)? a. Shortest Job First b. Longest Job First c. Preemptive Longest Job First d. Round Robin with a quantum of much less duration than the shortest job e. Round Robin with a quantum of longer duration than the longest job 3. (1 Point) What term is used to describe an error condition peculiar to concurrent programming where the results of a multi-threaded application change as the relative schedule of different threads varies? a. Memory Leak b. Race Condition c. Loose Semaphore d. Dinning Philosopher Problem e. Deadlock
Background image of page 1

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

View Full DocumentRight Arrow Icon
CS 241, Homework #2, Spring 2011 NetID: _________________________ 4. (1 Point) In many multi-threaded programs that are highly CPU intensive, application developers often provide a way to limit the maximum number of threads that can run concurrently. How could this be accomplished in a C program? a. It cannot be done. You must limit the number of tasks at the operating system level. b. By using the printf() command, the programmer limits the number of concurrent threads since there is only one console to print information. c. By using a semaphore, initialized to the maximum number of threads that are allowed to run concurrently. d. By using N mutexes, where N is the maximum number of threads that are allowed to run concurrently. e. None of the above. 5. (1 Point) When a POSIX signal is delivered to a user - process that did not setup a user - defined signal handler or does not mask the signal, what does happen? a.
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/28/2011 for the course CS 241 taught by Professor Campbell during the Spring '08 term at University of Illinois, Urbana Champaign.

Page1 / 7

cs241sp11hw2sol - CS 241, Homework #2, Spring 2011 NetID: _...

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

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