CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Sample Final Exam Questions (document version 1.1) WITH SELECTED SOLUTIONS
|
|
- Ellen Strickland
- 6 years ago
- Views:
Transcription
1 CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Sample Final Exam Questions (document version 1.1) WITH SELECTED SOLUTIONS Overview The final exam will be on Tuesday, May 17, 2016 from 11:30AM-2:30PM in Sage 3303 (please arrive early). The final exam will be 180 minutes; therefore, if you have 50% additional time, you will have 270 minutes (e.g., 11:30AM-4:00PM); if you have 100% additional time, you will have 360 minutes (e.g., 11:30AM-5:30PM). The final exam will count as 20% of your final course grade. You may bring two double-sided (or four single-sided) 8.5 x11 crib sheets containing anything you would like; crib sheets will not be collected. Final exams will not be handed back or available per review; however, exams will be graded multiple times to ensure correctness and consistency of grading. Final exam and final course grades will be made available. The final exam will be comprehensive. Sample Midterm Exam Questions 1. Given the following C program, what is the exact output? If multiple outputs are possible, succinctly describe all possibilities. Assume that all system calls complete successfully. Further, assume that the parent process ID is 168, with any child processes numbered 768, 769, 770, etc. int rc; printf( "ONE\n" ); rc = fork(); printf( "TWO\n" ); if ( rc == 0 ) printf( "THREE\n" ); if ( rc > 0 ) printf( "FOUR\n" ); return EXIT_SUCCESS;
2 2. Given the following C program, what is the exact output? If multiple outputs are possible, succinctly describe all possibilities. Assume that all system calls complete successfully. Further, assume that the parent process ID is 168, with any child processes numbered 768, 769, 770, etc. #include <sys/types.h> #include <sys/wait.h> int x = 150; printf( "PARENT: x is %d\n", x ); printf( "PARENT: forking...\n" ); pid_t pid = fork(); printf( "PARENT: forked...\n" ); if ( pid == 0 ) printf( "CHILD: happy birthday\n" ); x *= 2; printf( "CHILD: %d\n", x ); else wait( NULL ); printf( "PARENT: child completed\n" ); x *= 2; printf( "PARENT: %d\n", x ); return EXIT_SUCCESS; How would the output change if the wait() system call was removed from the code? 2
3 3. Given the following C program, what is the exact output? If multiple outputs are possible, succinctly describe all possibilities. Assume that all system calls complete successfully. printf( "ONE\n" ); fprintf( stderr, "ERROR: ONE\n" ); int rc = close( 1 ); printf( "==> %d\n", rc ); printf( "TWO\n" ); fprintf( stderr, "ERROR: TWO\n" ); rc = dup2( 2, 1 ); printf( "==> %d\n", rc ); printf( "THREE\n" ); fprintf( stderr, "ERROR: THREE\n" ); rc = close( 2 ); printf( "==> %d\n", rc ); printf( "FOUR\n" ); fprintf( stderr, "ERROR: FOUR\n" ); return EXIT_SUCCESS; 3
4 4. Given the following C program, what is the exact output? Further, what is the exact contents of the newfile.txt file? If multiple outputs are possible, succinctly describe all possibilities. Assume that all system calls complete successfully. #include <fcntl.h> int fd; close( 2 ); #if 0 close( 1 ); /* <== add this line later... */ #endif printf( "HI\n" ); fflush( stdout ); fd = open( "newfile.txt", O_WRONLY O_CREAT O_TRUNC, 0600 ); printf( "==> %d\n", fd ); printf( "WHAT?\n" ); fprintf( stderr, "ERROR\n" ); close( fd ); return EXIT_SUCCESS; How do the output and file contents change if the second close() system call is uncommented? 4
5 5. Given the following C program, what is the exact output? Further, what is the exact contents of the newfile.txt file? If multiple outputs are possible, succinctly describe all possibilities. Assume that all system calls complete successfully. Further, assume that the parent process ID is 168, with any child processes numbered 768, 769, 770, etc. #include <fcntl.h> #include <sys/wait.h> int fd; close( 2 ); #if 0 close( 1 ); /* <== add this line later... */ #endif printf( "HI\n" ); fflush( stdout ); fd = open( "newfile.txt", O_WRONLY O_CREAT O_TRUNC, 0600 ); printf( "==> %d\n", fd ); printf( "WHAT?\n" ); fprintf( stderr, "ERROR\n" ); fflush( stdout ); int rc = fork(); if ( rc == 0 ) printf( "AGAIN?\n" ); fprintf( stderr, "ERROR ERROR\n" ); else wait( NULL ); printf( "BYE\n" ); fprintf( stderr, "HELLO\n" ); return EXIT_SUCCESS; How do the output and file contents change if the second close() system call is uncommented? 5
6 6. Given the following C program, what is the exact output? If multiple outputs are possible, succinctly describe all possibilities. Assume that all system calls complete successfully. Further, assume that the parent process ID is 168, with any child processes numbered 768, 769, 770, etc. int rc; int p[2]; rc = pipe( p ); printf( "%d %d %d\n", getpid(), p[0], p[1] ); rc = fork(); if ( rc == 0 ) rc = write( p[1], "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 26 ); if ( rc > 0 ) char buffer[40]; rc = read( p[0], buffer, 8 ); buffer[rc] = '\0'; printf( "%d %s\n", getpid(), buffer ); printf( "BYE\n" ); return EXIT_SUCCESS; 6
7 7. Given the table of process burst times, arrival times, and priorities shown below, calculate the turnaround time, wait time, and number of preemptions for each process using the following scheduling algorithms: FCFS; SJF; SRT; RR with a time slice of 3 ms; and Priority scheduling with SJF as secondary scheduling algorithm (note that the lower the priority value, the higher priority the process has). PROCESS BURST TIME ARRIVAL TIME PRIORITY P1 7 ms 0 ms 2 P2 5 ms 0 ms 3 P3 5 ms 1 ms 1 P4 6 ms 4 ms 2 8. Write pseudocode for the scheduling algorithms above; for each, determine what the computational complexity of adding a process to the ready queue, of selecting the next process, and of removing a process from the queue. 9. For each scheduling algorithm above, describe whether CPU-bound or I/O-bound processes are favored. 10. For each scheduling algorithm above, describe how starvation can occur (or describe why it never will occur). 11. Given actual burst times for process P shown below and an initial guess of 6 ms, calculate the estimated next burst time for P by using exponential averaging with alpha (α) set to 0.5; recalculate with α set to 0.25 and Measured burst times for P are: 12 ms; 8 ms; 8 ms; 9 ms; and 4 ms. SOLUTION: Given α = 0.5, τ 0 = 6 ms, t 0 = 12 ms, t 1 = 8 ms, t 2 = 8 ms, t 3 = 9 ms, t 4 = 4 ms τ 1 = α t 0 + ( 1 - α ) τ 0 = 9 ms τ 2 = α t 1 + ( 1 - α ) τ 1 = 8.5 ms τ 3 = α t 2 + ( 1 - α ) τ 2 = 8.25 ms τ 4 = α t 3 + ( 1 - α ) τ 3 = ms τ 5 = α t 4 + ( 1 - α ) τ 4 = ms 12. Describe what happens when a child process terminates; also, what happens when a process that has child processes terminates? 13. In a shell, how might pipe functionality actually be implemented? Describe in detail. 14. Why might fork() fail? Why does a fork-bomb cause a system to potentially crash and how can a fork-bomb be avoided by an operating system? 7
8 Sample Final Exam Questions 15. Given the following C program, what is the exact output? If multiple outputs are possible, succinctly describe all possibilities. Assume that all system calls and pthread library calls complete successfully. Further, assume that the main thread ID is 1984, with any child threads numbered 100, 101, 102, etc. #include <pthread.h> void * action( void * arg ) int t = *(int *)arg; printf( "THREAD %u: I'm alive %d\n", (unsigned int)pthread_self(), t ); sleep( t ); return NULL; pthread_t tid[4]; int i, t; for ( i = 0 ; i < 4 ; i++ ) t = 1 + i * 3; printf( "MAIN: Creating thread for task %d\n", t ); pthread_create( &tid[i], NULL, action, &t ); for ( i = 0 ; i < 4 ; i++ ) pthread_join( tid[i], NULL ); printf( "MAIN: Joined child thread %u\n", (unsigned int)tid[i] ); return 0; 16. What is the behavior of the given code if the second for loop (i.e., the loop that includes the pthread_join() call) is entirely removed? 17. Describe how the inconsistencies in the child threads (i.e., in terms of their inputs) would be corrected in the above code. 8
9 SOLUTION TO 15: This program displays the three blocks of output shown below. Block A: MAIN: Creating thread for task 1 MAIN: Creating thread for task 4 MAIN: Creating thread for task 7 MAIN: Creating thread for task 10 Block B: THREAD 100: I'm alive 1 (or 4 or 7 or 10) THREAD 101: I'm alive 4 (or 7 or 10) THREAD 102: I'm alive 7 (or 10) THREAD 103: I'm alive 10 Block C: MAIN: Joined child thread 100 MAIN: Joined child thread 101 MAIN: Joined child thread 102 MAIN: Joined child thread 103 For Blocks A and C, the output shown above must appear in the given relative order (i.e., the four lines of Block A must be in the order shown, and the four lines of Block C must be in the order shown). For Block B, the four lines of output may be in any order. Further, because local variable t is statically allocated in the main() function, each thread receives the address of this variable. Therefore, thread 100 may see the contents of t contain 1, 4, 7, or 10; thread 101 may see the contents of t contain 4, 7, or 10; and thread 102 may see the contents of t contain 7 or 10. For each thread (i.e., 100 to 103), there are three corresponding lines of output in Block A, Block B, and Block C, which must be in block order, e.g., as shown below for thread 100: MAIN: Creating thread for task 1 THREAD 100: I'm alive 1 (or 4 or 7 or 10) MAIN: Joined child thread 100 SOLUTION TO 16: If the second for loop is removed, the main thread does not wait for the child threads. Therefore, output from Block C above is not displayed. Further, output from Block B may or may not be displayed, since the main thread might exit (i.e. thus terminating the entire process) before the child threads are done. SOLUTION TO 17: As noted above in the solution to 15, variable t is statically allocated in the main() function. To correct this and ensure that each thread gets its own correct value of t, memory should be dynamically allocated at each iteration of the first for loop. 9
10 18. Contiguous Memory Allocation: Consider a contiguous memory allocation scheme with dynamic partitioning for a 64MB physical memory with five pre-allocated processes (i.e., A, B, C, D, and E) that just happen to have memory requirements that are evenly divisible by 1MB. Given new processes F, G, and H) that arrive (almost) simultaneously in the order shown below, show how memory allocation occurs for each of the given placement algorithms. Arrival Order ProcessID Memory Requirements ======================================================= 1 F 2,987,642 bytes 2 G 4,002,016 bytes 3 H 6,202,454 bytes ======================================================= Note that if a process cannot be placed, be sure to state that, then move on to the next process. Do not perform defragmentation. For the memory allocation shown below, apply the First Fit algorithm: Memory: AAAAAAAAA...B BBBBBB...CCCCC CCCC...DDDDDDDDD DDDD...EEE (each character here represents 1MB) For the memory allocation shown below, apply the Best Fit algorithm: Memory: AAAABBBBBBBBBBBB BBBBBBBB...CCCC CCCCC...DDDDDDDD DDDDDD...EEE For the memory allocation shown below, apply the Next Fit algorithm, with process D being the last-placed process: Memory: AAAAAAAAAA...B BBBBBBBB...CCC CCCCCC...DDDDDDD DDDD...EEEE 19. For each of the above algorithms, how much space is unused after the processes are allocated to memory? 20. For each of the above, what kind of fragmentation occurs (i.e., internal or external)? 10
11 SOLUTIONS TO 18, 19, AND 20: First, please note that 1MB is 2 20 or 1,048,576 bytes. After the First Fit algorithm is applied: Memory: AAAAAAAAAFFF...B (F uses 2,987,642 bytes of 6MB free) BBBBBBGGGG.CCCCC (G uses 4,002,016 bytes of 5MB free) CCCC...DDDDDDDDD DDDDHHHHHH...EEE (H uses 6,202,454 bytes of 9MB free) There is therefore external fragmentation, calculated as follows: ( 6MB - 2,987,642 ) + ( 5MB - 4,002,016 ) + 3MB + ( 9MB - 6,202,454 ) After the Best Fit algorithm is applied: Memory: AAAABBBBBBBBBBBB BBBBBBBBGGGGCCCC (G uses 4,002,016 bytes of 4MB free) CCCCCFFFDDDDDDDD (F uses 2,987,642 bytes of 3MB free) DDDDDDHHHHHH.EEE (H uses 6,202,454 bytes of 7MB free) There is therefore external fragmentation, calculated as follows: ( 4MB - 4,002,016 ) + ( 3MB - 2,987,642 ) + ( 7MB - 6,202,454 ) After the Next Fit algorithm is applied: Memory: AAAAAAAAAA...B BBBBBBBB...CCC CCCCCC...DDDDDDD DDDDFFFGGGG.EEEE (F uses 2,987,642 bytes and G uses 4,002,016 bytes of 8MB free) (H cannot be placed) There is therefore external fragmentation, calculated as follows: ( 8MB - 2,987,642-4,002,016 ) + 5MB + 5MB + 3MB 11
12 21. Noncontiguous Memory Allocation: Consider a noncontiguous memory allocation scheme in which a logical memory address is represented using 32 bits. Of these bits, the high-order 12 bits represent the page number; the remaining bits represent the page offset. What is the total logical memory space (i.e., how many bytes are addressed)? SOLUTION: 2 32 How many pages are there? SOLUTION: 2 12 What is the page size? SOLUTION: 2 20 What is the frame size? SOLUTION: 2 20 (same as page size) How does logical memory address 23,942,519 (binary ) map to physical memory (i.e., what is the logical page number and page offset)? SOLUTION: page number is (i.e., ); page offset is If a process requires 78,901,234 bytes of memory, how many pages will it require? SOLUTION: ans = ceil( 78,901,234 / 2 20 ) How many bytes are unused due to external fragmentation? SOLUTION: 0 (there is no external fragmentation, because the entirety of physical memory is partitioned into equally sized frames) How many bytes are unused due to internal fragmentation? SOLUTION: ( 2 20 ans ) - 78,901,234 Given that the page table is stored entirely in memory and a memory reference takes 100 nanoseconds, how long does a paged memory reference take? SOLUTION: 200 ns Adding a translation look-aside buffer (TLB) with a TLB access time of 15 nanoseconds, how long does a paged memory reference take if a TLB hit occurs? SOLUTION: 115 ns Given a TLB hit ratio of 84%, what is the effective memory access time (EMAT)? SOLUTION: ns ns 12
13 22. Virtual Memory: Given a page reference string and an n-frame memory, how many page faults occur for the following page replacement algorithms: FIFO; OPT; LRU; LFU. Page Reference Stream: Given a page reference string and a working set delta, identify the working set at the point indicated below. Page Reference Stream: ^ Use a delta of 3, 5, then 8. SOLUTION: If the delta value does not include the current page reference, then: working set with delta of 3 is 3, 4, 7, 8; working set with delta of 5 is also 3, 4, 7, 8; working set with delta of 8 is also 3, 4, 7, 8; if we set delta to 9, working set is 1, 3, 4, 7, 8 If the delta value does include the current page reference, then: working set with delta of 3 is 3, 4, 7; working set with delta of 5 is also 3, 4, 7, 8; and working set with delta of 8 is also 3, 4, 7, 8 Either will be correct (i.e., both approaches are a valid way of using the delta value). 13
CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Sample Midterm Exam Questions (document version 1.1)
CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Sample Midterm Exam Questions (document version 1.1) Overview The midterm exam will be in class on Monday, March 28, 2016 from 10:00-11:45AM
More informationCSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Sample Exam 1 Questions (document version 1.1)
CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Sample Exam 1 Questions (document version 1.1) Overview Exam 1 will be in class on Thursday, February 22, 2018 from 10:00-11:45AM (please
More informationCSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Sample Final Exam Questions (document version 1.0) WITH SELECTED SOLUTIONS
CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Sample Final Exam Questions (document version 1.0) WITH SELECTED SOLUTIONS Overview Our final exam will be on Thursday, May 10, 2018 from
More informationProcess Turnaround Time Total Wait Time P 1 12 ms 0 ms P 2 21 ms 12 ms P 3 23 ms 18 ms P 4 20 ms 17 ms
Name: SOLUTIONS Score: / 100 CSCI-4210/6140 Operating Systems Midterm Exam Thursday 10/9 1-PAGE (2-SIDED) CRIB SHEET ALLOWED; NO CALCULATOR ANSWER ALL QUESTIONS; USE EXTRA PAPER AS NECESSARY 1. [25 POINTS]
More informationCSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Sample Exam 2 Questions (document version 1.0)
CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Sample Exam 2 Questions (document version 1.0) Overview Exam 2 will be in class on Thursday, April 13, 2017 from 10:00-11:45AM (please arrive
More informationB. V. Patel Institute of Business Management, Computer &Information Technology, UTU
BCA-3 rd Semester 030010304-Fundamentals Of Operating Systems Unit: 1 Introduction Short Answer Questions : 1. State two ways of process communication. 2. State any two uses of operating system according
More information( D ) 4. Which is not able to solve the race condition? (A) Test and Set Lock (B) Semaphore (C) Monitor (D) Shared memory
CS 540 - Operating Systems - Final Exam - Name: Date: Wenesday, May 12, 2004 Part 1: (78 points - 3 points for each problem) ( C ) 1. In UNIX a utility which reads commands from a terminal is called: (A)
More information( B ) 4. Which is not able to solve the race condition? (A) Test and Set Lock (B) Shared memory (C) Semaphore (D) Monitor
CS 540 - Operating Systems - Final Exam - Name: Date: Monday, May 12, 2003 Part 1: (80 + 8 (bonus) points - 4 points for each problem) ( C ) 1. In an operating system a utility which reads commands from
More informationFirst Midterm Exam Solutions October 1, 2018 CS162 Operating Systems
University of California, Berkeley College of Engineering Computer Science Division EECS Fall 2018 Ion Stoica First Midterm Exam Solutions October 1, 2018 CS162 Operating Systems Your Name: SID AND 162
More informationIC221: Systems Programming 12-Week Written Exam [SOLUTIONS]
IC221: Systems Programming 12-Week Written Exam [SOLUTIONS] April 2, 2014 Answer the questions in the spaces provided on the question sheets. If you run out of room for an answer, continue on the back
More informationOperating Systems Comprehensive Exam. Spring Student ID # 3/16/2006
Operating Systems Comprehensive Exam Spring 2006 Student ID # 3/16/2006 You must complete all of part I (60%) You must complete two of the three sections in part II (20% each) In Part I, circle or select
More informationOperating Systems Comprehensive Exam. Spring Student ID # 3/20/2013
Operating Systems Comprehensive Exam Spring 2013 Student ID # 3/20/2013 You must complete all of Section I You must complete two of the problems in Section II If you need more space to answer a question,
More informationCS 3113 Introduction to Operating Systems Midterm October 11, 2018
General instructions: CS 3113 Introduction to Operating Systems Midterm October 11, 2018 Please wait to open this exam booklet until you are told to do so. This examination booklet has 10 pages. You also
More informationCS 3113 Introduction to Operating Systems Midterm October 11, 2018
General instructions: CS 3113 Introduction to Operating Systems Midterm October 11, 2018 Please wait to open this exam booklet until you are told to do so. This examination booklet has 10 pages. You also
More informationProcess Creation in UNIX
Process Creation in UNIX int fork() create a child process identical to parent Child process has a copy of the address space of the parent process On success: Both parent and child continue execution at
More informationOperating systems fundamentals - B06
Operating systems fundamentals - B06 David Kendall Northumbria University David Kendall (Northumbria University) Operating systems fundamentals - B06 1 / 12 Introduction Introduction to threads Reminder
More informationOperating Systems Comprehensive Exam. Fall Student ID # 10/31/2013
Operating Systems Comprehensive Exam Fall 2013 Student ID # 10/31/2013 You must complete all of Section I You must complete two of the problems in Section II If you need more space to answer a question,
More informationUniversity of Ottawa School of Information Technology and Engineering
University of Ottawa School of Information Technology and Engineering Course: CSI3131 Operating Systems Professor: Miguel A. Garzón SEMESTER: Winter 2015 Date: Feb 26 2015 Hour: 14:30-16:00 (90 minutes)
More informationMidterm Exam October 15, 2012 CS162 Operating Systems
CS 62 Fall 202 Midterm Exam October 5, 202 University of California, Berkeley College of Engineering Computer Science Division EECS Fall 202 Ion Stoica Midterm Exam October 5, 202 CS62 Operating Systems
More informationSection 2: Processes
September 7, 2016 Contents 1 Warmup 2 1.1 Hello World............................................ 2 2 Vocabulary 2 3 Problems 3 3.1 Forks................................................ 3 3.2 Stack Allocation.........................................
More informationOS 1 st Exam Name Solution St # (Q1) (19 points) True/False. Circle the appropriate choice (there are no trick questions).
OS 1 st Exam Name Solution St # (Q1) (19 points) True/False. Circle the appropriate choice (there are no trick questions). (a) (b) (c) (d) (e) (f) (g) (h) (i) T_ The two primary purposes of an operating
More informationInter-Process Communication
CS 326: Operating Systems Inter-Process Communication Lecture 10 Today s Schedule Shared Memory Pipes 2/28/18 CS 326: Operating Systems 2 Today s Schedule Shared Memory Pipes 2/28/18 CS 326: Operating
More informationOperating Systems, laboratory exercises. List 2.
Operating Systems, laboratory exercises. List 2. Subject: Creating processes and threads with UNIX/Linux API functions. 1. Creating a process with UNIX API function. To create a new process from running
More informationCSci 4061 Introduction to Operating Systems. IPC: Basics, Pipes
CSci 4061 Introduction to Operating Systems IPC: Basics, Pipes Today Directory wrap-up Communication/IPC Test in one week Communication Abstraction: conduit for data exchange between two or more processes
More informationCS240: Programming in C
CS240: Programming in C Lecture 16: Process and Signals Cristina Nita-Rotaru Lecture 16/ Fall 2013 1 Processes in UNIX UNIX identifies processes via a unique Process ID Each process also knows its parent
More informationProcesses. Overview. Processes. Process Creation. Process Creation fork() Processes. CPU scheduling. Pål Halvorsen 21/9-2005
INF060: Introduction to Operating Systems and Data Communication Operating Systems: Processes & CPU Pål Halvorsen /9-005 Overview Processes primitives for creation and termination states context switches
More informationCS510 Operating System Foundations. Jonathan Walpole
CS510 Operating System Foundations Jonathan Walpole The Process Concept 2 The Process Concept Process a program in execution Program - description of how to perform an activity instructions and static
More informationEECE.4810/EECE.5730: Operating Systems Spring Midterm Exam March 8, Name: Section: EECE.4810 (undergraduate) EECE.
EECE.4810/EECE.5730: Operating Systems Spring 2017 Midterm Exam March 8, 2017 Name: Section: EECE.4810 (undergraduate) EECE.5730 (graduate) For this exam, you may use two 8.5 x 11 double-sided page of
More informationCS Operating system Summer Midterm I -- July 11, 2017 You have 115 min (10:00am-11:55pm). Good Luck!
Name / ID (please PRINT) Seq#: Seat #: CS 3733.001 -- Operating system Summer 2017 -- Midterm I -- July 11, 2017 You have 115 min (10:00am-11:55pm). Good Luck! This is a closed book/note examination. But
More informationProcesses COMPSCI 386
Processes COMPSCI 386 Elements of a Process A process is a program in execution. Distinct processes may be created from the same program, but they are separate execution sequences. call stack heap STACK
More informationSpring CS 170 Exercise Set 1 (Updated with Part III)
Spring 2015. CS 170 Exercise Set 1 (Updated with Part III) Due on May 5 Tuesday 12:30pm. Submit to the CS170 homework box or bring to the classroom. Additional problems will be added as we cover more topics
More informationCSC 716 Advanced Operating System Fall 2007 Exam 1. Answer all the questions. The maximum credit for each question is as shown.
CSC 716 Advanced Operating System Fall 2007 Exam 1 Answer all the questions. The maximum credit for each question is as shown. 1. (15) Multiple Choice(3 points for each): 1) Which of the following statement
More informationExam Guide COMPSCI 386
FOUNDATIONS We discussed in broad terms the three primary responsibilities of an operating system. Describe each. What is a process? What is a thread? What parts of a process are shared by threads? What
More informationThis homework is due by 11:59:59 PM on Thursday, October 12, 2017.
CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Homework 2 (document version 1.3) Process Creation and Inter-Process Communication (IPC) in C Overview This homework is due by 11:59:59
More informationWeek 2 Intro to the Shell with Fork, Exec, Wait. Sarah Diesburg Operating Systems CS 3430
Week 2 Intro to the Shell with Fork, Exec, Wait Sarah Diesburg Operating Systems CS 3430 1 Why is the Shell Important? Shells provide us with a way to interact with the core system Executes programs on
More informationOperating Systems. Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000) alphapeeler.sf.net/pubkeys/pkey.htm
Operating Systems Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000) armahmood786@yahoo.com alphasecure@gmail.com alphapeeler.sf.net/pubkeys/pkey.htm http://alphapeeler.sourceforge.net pk.linkedin.com/in/armahmood
More informationDelhi Noida Bhopal Hyderabad Jaipur Lucknow Indore Pune Bhubaneswar Kolkata Patna Web: Ph:
Serial :. T_CS_A_Operating System_ Delhi Noida Bhopal yderabad Jaipur Lucknow Indore une Bhubaneswar Kolkata atna Web: E-mail: info@madeeasy.in h: - CLASS TEST - COMUTER SCIENCE & IT Subject : Operating
More informationCS 322 Operating Systems Practice Midterm Questions
! CS 322 Operating Systems 1. Processes go through the following states in their lifetime. time slice ends Consider the following events and answer the questions that follow. Assume there are 5 processes,
More informationECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Processes and threads
ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective Part I: Operating system overview: Processes and threads 1 Overview Process concept Process scheduling Thread
More informationChapter 5 CPU scheduling
Chapter 5 CPU scheduling Contents Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Real-Time Scheduling Thread Scheduling Operating Systems Examples Java Thread Scheduling
More informationCS 333 Introduction to Operating Systems. Class 3 Threads & Concurrency. Jonathan Walpole Computer Science Portland State University
CS 333 Introduction to Operating Systems Class 3 Threads & Concurrency Jonathan Walpole Computer Science Portland State University 1 Process creation in UNIX All processes have a unique process id getpid(),
More informationChapter 5: Process Scheduling
Chapter 5: Process Scheduling Chapter 5: Process Scheduling Basic Concepts Scheduling Criteria Scheduling Algorithms Multiple-Processor Scheduling Thread Scheduling Operating Systems Examples Algorithm
More informationCHAPTER 2: PROCESS MANAGEMENT
1 CHAPTER 2: PROCESS MANAGEMENT Slides by: Ms. Shree Jaswal TOPICS TO BE COVERED Process description: Process, Process States, Process Control Block (PCB), Threads, Thread management. Process Scheduling:
More informationEECE.4810/EECE.5730: Operating Systems Spring 2017
EECE.4810/EECE.5730: Operating Systems Spring 2017 Midterm Exam Solution 1. (19 + 6 points) UProcess management Parts (a) and (b) of this problem refer to the following program: int main() { pid_t pid1,
More informationCSE 4/521 Introduction to Operating Systems
CSE 4/521 Introduction to Operating Systems Lecture 9 CPU Scheduling II (Scheduling Algorithms, Thread Scheduling, Real-time CPU Scheduling) Summer 2018 Overview Objective: 1. To describe priority scheduling
More informationIndian Institute of Technology, Kharagpur
1 Indian Institute of Technology, Kharagpur End-Spring Semester 2017-18 Date of Examination: 24-04-2018 Session: AN (2-5 pm) Duration: 3 hrs Subject No.: CS31702 Subject: COMPUTER ARCHITECTURE AND OPERATING
More informationCSC Operating Systems Spring Lecture - XII Midterm Review. Tevfik Ko!ar. Louisiana State University. March 4 th, 2008.
CSC 4103 - Operating Systems Spring 2008 Lecture - XII Midterm Review Tevfik Ko!ar Louisiana State University March 4 th, 2008 1 I/O Structure After I/O starts, control returns to user program only upon
More informationCSci 4061 Introduction to Operating Systems. (Threads-POSIX)
CSci 4061 Introduction to Operating Systems (Threads-POSIX) How do I program them? General Thread Operations Create/Fork Allocate memory for stack, perform bookkeeping Parent thread creates child threads
More informationChapter 5: CPU Scheduling
COP 4610: Introduction to Operating Systems (Fall 2016) Chapter 5: CPU Scheduling Zhi Wang Florida State University Contents Basic concepts Scheduling criteria Scheduling algorithms Thread scheduling Multiple-processor
More informationProcess Management 1
Process Management 1 Goals of this Lecture Help you learn about: Creating new processes Programmatically redirecting stdin, stdout, and stderr (Appendix) communication between processes via pipes Why?
More informationTechno India Batanagar Department of Computer Science & Engineering. Model Questions. Multiple Choice Questions:
Techno India Batanagar Department of Computer Science & Engineering Model Questions Subject Name: Operating System Multiple Choice Questions: Subject Code: CS603 1) Shell is the exclusive feature of a)
More informationThis exam paper contains 8 questions (12 pages) Total 100 points. Please put your official name and NOT your assumed name. First Name: Last Name:
CSci 4061: Introduction to Operating Systems (Spring 2013) Final Exam May 14, 2013 (4:00 6:00 pm) Open Book and Lecture Notes (Bring Your U Photo Id to the Exam) This exam paper contains 8 questions (12
More informationYork University Lassonde School of Engineering Department of Electrical Engineering and Computer Science
York University Lassonde School of Engineering Department of Electrical Engineering and Computer Science Midterm EECS 3221.03Z Operating Systems Fundamentals Feb 26, 2015 (14:30-16:00) Section: EECS3221Z
More informationCSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Homework 3 (document version 1.2) Multi-threading in C using Pthreads
CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Homework 3 (document version 1.2) Multi-threading in C using Pthreads Overview This homework is due by 11:59:59 PM on Tuesday, April 10,
More informationLinux Programming
Linux Programming CMPT 433 Slides #6 Dr. B. Fraser 18-05-22 1 Topics 1) How can we do multitasking? 2) How can our multiple tasks communicate? 3) How can we communicate over the network? 18-05-22 2 Concurrency:
More informationENGR 3950U / CSCI 3020U Midterm Exam SOLUTIONS, Fall 2012 SOLUTIONS
SOLUTIONS ENGR 3950U / CSCI 3020U (Operating Systems) Midterm Exam October 23, 2012, Duration: 80 Minutes (10 pages, 12 questions, 100 Marks) Instructor: Dr. Kamran Sartipi Question 1 (Computer Systgem)
More informationClass average is Undergraduates are performing better. Working with low-level microcontroller timers
Student feedback Low grades of the midterm exam Class average is 86.16 Undergraduates are performing better Cheat sheet on the final exam? You will be allowed to bring one page of cheat sheet to the final
More informationCROWDMARK. Examination Midterm. Spring 2017 CS 350. Closed Book. Page 1 of 30. University of Waterloo CS350 Midterm Examination.
Times: Thursday 2017-06-22 at 19:00 to 20:50 (7 to 8:50PM) Duration: 1 hour 50 minutes (110 minutes) Exam ID: 3520593 Please print in pen: Waterloo Student ID Number: WatIAM/Quest Login Userid: Sections:
More informationCOMP 3361: Operating Systems 1 Final Exam Winter 2009
COMP 3361: Operating Systems 1 Final Exam Winter 2009 Name: Instructions This is an open book exam. The exam is worth 100 points, and each question indicates how many points it is worth. Read the exam
More informationCS 333 Introduction to Operating Systems. Class 3 Threads & Concurrency. Jonathan Walpole Computer Science Portland State University
CS 333 Introduction to Operating Systems Class 3 Threads & Concurrency Jonathan Walpole Computer Science Portland State University 1 The Process Concept 2 The Process Concept Process a program in execution
More informationCOE518 Lecture Notes Week 4 (Sept. 26, 2011)
coe518 (Operating Systems) Lecture Notes: Week 4 Page 1 of 11 COE518 Lecture Notes Week 4 (Sept. 26, 2011) Topics Why fork(), then exec()? The delta list structure Alternative approach to Lab 2 More on
More informationProcess Management! Goals of this Lecture!
Process Management! 1 Goals of this Lecture! Help you learn about:" Creating new processes" Programmatically redirecting stdin, stdout, and stderr" (Appendix) communication between processes via pipes"
More informationMC7204 OPERATING SYSTEMS
MC7204 OPERATING SYSTEMS QUESTION BANK UNIT I INTRODUCTION 9 Introduction Types of operating systems operating systems structures Systems components operating systems services System calls Systems programs
More informationChapter 6: CPU Scheduling
Chapter 6: CPU Scheduling Silberschatz, Galvin and Gagne Histogram of CPU-burst Times 6.2 Silberschatz, Galvin and Gagne Alternating Sequence of CPU And I/O Bursts 6.3 Silberschatz, Galvin and Gagne CPU
More informationPROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo
PROCESS MANAGEMENT Operating Systems 2015 Spring by Euiseong Seo Today s Topics Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication
More informationCPU Scheduling. Basic Concepts. Histogram of CPU-burst Times. Dispatcher. CPU Scheduler. Alternating Sequence of CPU and I/O Bursts
CS307 Basic Concepts Maximize CPU utilization obtained with multiprogramming CPU Scheduling CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait CPU burst distribution
More informationPh.D. Programme in Computer Science. Model Question Paper RESEARCH APTITUDE ASSESSMENT TEST. Time : 2 Hours Max. Marks : 75
Ph.D. Programme in Computer Science Model Question Paper RESEARCH APTITUDE ASSESSMENT TEST : 2 Hours Max. Marks : 75 I. Part A: Multiple Choice Questions 30 x 1 mark = 30 marks Choose the correct Response
More informationAssignment 3 (Due date: Thursday, 10/15/2009, in class) Part One: Provide brief answers to the following Chapter Exercises questions:
Assignment 3 (Due date: Thursday, 10/15/2009, in class) Your name: Date: Part One: Provide brief answers to the following Chapter Exercises questions: 4.7 Provide two programming examples in which multithreading
More informationALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far.
Midterm Exam Reviews ALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far. Particular attentions on the following: System call, system kernel Thread/process, thread vs process
More informationOperating systems Portfolio
Operating systems Portfolio Thebault Yann Student number : 10004434 CE0100-3 Operating systems! Friday 26 November 2010 WEEK 1 6. How does the distinction between supervisor mode and user mode function
More informationInput and Output System Calls
Chapter 2 Input and Output System Calls Internal UNIX System Calls & Libraries Using C --- 1011 OBJECTIVES Upon completion of this unit, you will be able to: Describe the characteristics of a file Open
More informationLSN 13 Linux Concurrency Mechanisms
LSN 13 Linux Concurrency Mechanisms ECT362 Operating Systems Department of Engineering Technology LSN 13 Creating Processes fork() system call Returns PID of the child process created The new process is
More informationMaria Hybinette, UGA. ! One easy way to communicate is to use files. ! File descriptors. 3 Maria Hybinette, UGA. ! Simple example: who sort
Two Communicating Processes Hello Gunnar CSCI 6730/ 4730 Operating Systems Process Chat Maria A Hi Nice to Hear from you Process Chat Gunnar B Dup & Concept that we want to implement 2 On the path to communication
More informationFilesystems (just a bit): File allocation tables, free-bitmaps, free-lists, inodes, and performance considerations.
CSCI 346 Final Exam Review Questions -- Solutions The final exam will be Tuesday, May 17, 11:30-2:00 PM, in Swords 328. If you have not made arrangements with me and confirmed by email, you must take the
More informationCMPSC 311- Introduction to Systems Programming Module: Concurrency
CMPSC 311- Introduction to Systems Programming Module: Concurrency Professor Patrick McDaniel Fall 2013 Sequential Programming Processing a network connection as it arrives and fulfilling the exchange
More informationCS Operating system
Name / ID (please PRINT) Seq#: Seat Number CS 3733.001 -- Operating system Spring 2017 -- Midterm II -- April 13, 2017 You have 75 min. Good Luck! This is a closed book/note examination. But You can use
More informationCMPSC 311- Introduction to Systems Programming Module: Concurrency
CMPSC 311- Introduction to Systems Programming Module: Concurrency Professor Patrick McDaniel Fall 2013 Sequential Programming Processing a network connection as it arrives and fulfilling the exchange
More informationCSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Homework 4 (document version 1.1) Sockets and Server Programming using C
CSCI 4210 Operating Systems CSCI 6140 Computer Operating Systems Homework 4 (document version 1.1) Sockets and Server Programming using C Overview This homework is due by 11:59:59 PM on Monday, December
More informationCPU Scheduling Algorithms
CPU Scheduling Algorithms Notice: The slides for this lecture have been largely based on those accompanying the textbook Operating Systems Concepts with Java, by Silberschatz, Galvin, and Gagne (2007).
More informationProcesses. CS 475, Spring 2018 Concurrent & Distributed Systems
Processes CS 475, Spring 2018 Concurrent & Distributed Systems Review: Abstractions 2 Review: Concurrency & Parallelism 4 different things: T1 T2 T3 T4 Concurrency: (1 processor) Time T1 T2 T3 T4 T1 T1
More informationWindows architecture. user. mode. Env. subsystems. Executive. Device drivers Kernel. kernel. mode HAL. Hardware. Process B. Process C.
Structure Unix architecture users Functions of the System tools (shell, editors, compilers, ) standard library System call Standard library (printf, fork, ) OS kernel: processes, memory management, file
More informationQ1. State True/false with jusification if the answer is false:
Paper Title: Operating System (IOPS332C) Quiz 1 Time : 1 hr Q1. State True/false with jusification if the answer is false: a. Multiprogramming (having more programs in RAM simultaneously) decreases total
More informationJob Scheduling. CS170 Fall 2018
Job Scheduling CS170 Fall 2018 What to Learn? Algorithms of job scheduling, which maximizes CPU utilization obtained with multiprogramming Select from ready processes and allocates the CPU to one of them
More informationIntroduction to Processes
Computer Systems II Introduction to Processes 1 Review: Basic Computer Hardware CPU Instruction Register Control BUS read (disk) local buffer Disk Controller Memory Executable Disk 1 Review: Timing Problem
More informationINF1060: Introduction to Operating Systems and Data Communication. Pål Halvorsen. Wednesday, September 29, 2010
INF1060: Introduction to Operating Systems and Data Communication Pål Halvorsen Wednesday, September 29, 2010 Overview Processes primitives for creation and termination states context switches processes
More informationCSci 4061 Introduction to Operating Systems. IPC: Basics, Pipes
CSci 4061 Introduction to Operating Systems IPC: Basics, Pipes Communication IPC in Unix Pipes: most basic form of IPC in Unix process-process ps u jon grep tcsh // what happens? Pipe has a read-end (receive)
More informationCMPSC 311- Introduction to Systems Programming Module: Concurrency
CMPSC 311- Introduction to Systems Programming Module: Concurrency Professor Patrick McDaniel Fall 2016 Sequential Programming Processing a network connection as it arrives and fulfilling the exchange
More informationProcess Management! Goals of this Lecture!
Process Management! 1 Goals of this Lecture! Help you learn about:" Creating new processes" Programmatically redirecting stdin, stdout, and stderr" Unix system-level functions for I/O" The Unix stream
More informationCS 3214 Midterm. Here is the distribution of midterm scores for both sections (combined). Midterm Scores 20. # Problem Points Score
CS 3214 Here is the distribution of midterm scores for both sections (combined). Scores 20 18 16 14 12 10 8 6 4 2 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 0 The overall average was 58 points.
More informationCSci 4061 Introduction to Operating Systems. IPC: Basics, Pipes
CSci 4061 Introduction to Operating Systems IPC: Basics, Pipes Communication IPC in Unix Pipes: most basic form of IPC in Unix process-process ps u jon grep tcsh // what happens? Pipe has a read-end (receive)
More informationChapter 3 Processes we will completely ignore threads today
Chapter 3 Processes we will completely ignore threads today Images from Silberschatz Pacific University 1 Process Define: Memory Regions: Loaded from executable file: ELF: Executable and Linkable Format
More informationHomework 1. b. Can we ensure the same degree of security in a time shared machine as in a dedicated machine? Explain your answer.
CSE 430 Name: Bing Hao Operating Systems (2013 Summer) 2013 Problems: 1.13, 1.22, 1.23, 1.25, 2.5, 2.17, 2.18 Home Page: http://uniteng.com Homework 1 Question: 1.13 In a multiprogramming and time sharing
More informationCS240: Programming in C
CS240: Programming in C Lecture 17: Processes, Pipes, and Signals Cristina Nita-Rotaru Lecture 17/ Fall 2013 1 Processes in UNIX UNIX identifies processes via a unique Process ID Each process also knows
More informationLecture 2 Process Management
Lecture 2 Process Management Process Concept An operating system executes a variety of programs: Batch system jobs Time-shared systems user programs or tasks The terms job and process may be interchangeable
More informationStudent Name: University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science
University of California at Berkeley College of Engineering Department of Electrical Engineering and Computer Science CS 162 Spring 2011 I. Stoica FIRST MIDTERM EXAMINATION Wednesday, March 9, 2011 INSTRUCTIONS
More informationLab 5: Inter-Process Communication
1. Objective Lab 5: Inter-Process Communication Study the inter-process communication 2. Syllabus Understanding the concepts and principle of inter-process communication Implementing the inter-process
More informationPreview. Process Control. What is process? Process identifier The fork() System Call File Sharing Race Condition. COSC350 System Software, Fall
Preview Process Control What is process? Process identifier The fork() System Call File Sharing Race Condition COSC350 System Software, Fall 2015 1 Von Neumann Computer Architecture: An integrated set
More informationOperating Systems Lab
Operating Systems Lab Islamic University Gaza Engineering Faculty Department of Computer Engineering Fall 2012 ECOM 4010: Operating Systems Lab Eng: Ahmed M. Ayash Lab # 3 Fork() in C and C++ programming
More informationCS , Fall 2003 Exam 2
Andrew login ID: Full Name: CS 15-213, Fall 2003 Exam 2 November 18, 2003 Instructions: Make sure that your exam is not missing any sheets, then write your full name and Andrew login ID on the front. Write
More informationCS Mid term Exam Maximum points 100; Maximum time allowed: 75 minutes
CS 470 - Mid term Exam Maximum points 100; Maximum time allowed: 75 minutes Name: Note: Answer all questions. Your answers should be brief and precise to the point. Note that a statement is true means
More information