



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Exam; Class: COMP SYS STRUCT; Subject: ELECTRICAL AND COMPUTER ENGINEERING; University: Clemson University; Term: Spring 2006;
Typology: Exams
1 / 7
This page cannot be seen from the preview
Don't miss anything!




batch system process round-robin monitor multi-programmed sys. PCB shortest remaining time first critical region time-shared sys. waiting queue aging critical section hard real-time running queue starvation hold-and-wait soft real-time ready queue deadlock no preemption interrupt vector CPU scheduler multilevel queue scheduling circular wait device status table time quantum queueing-network analysis deadlock prevention asynchronous IO long-term scheduler simulation deadlock avoidance synchronous IO short-term scheduler race condition deadlock detection DMA degree of multiprogramming multilevel feedback queue scheduling deadlock recovery memory-mapped IO process mix mutual exclusion bounded buffer programmed IO medium-term scheduler bakery algorithm user mode interrupt-driven IO context switch banker's algorithm supervisor mode cache thread atomicity main memory volatile user-level threads fetch and add hard disk drive non-volatile kernel-level threads semaphore sigsetjmp microkernel first come first serve spinlock siglongjmp monolithic kernel shortest job first readers writers setitimer __semaphore____: A synchronization mechanism that is higher level than hardware-based approaches and provides a counter for solving a variety of synchronization problems. __time-shared systems_____: Allows users to interact with their programs by switching among them fast enough that the response time is usually tolerable. ____race condition____: Causes the outcome to depend on the order in which concurrent accesses take place and is often associated with non-deterministic behavior. asynchronous I/O: Control is immediately returned to the user program without waiting for completion. ______aging______: Technique is used in conjunction with scheduling algorithm to dynamically adjust process
_____programmed I/O______: Status must be polled to determine completion. (spinlock -.5)
2.) True/False: For each statement, indicate whether the statement is true (T) or false (F). If a statement is not necessarily true, then it is false. (15 points) T Processes wait in the ready queue. (processes wait in the ready queue to chosen by the CPU scheduler for access to the processor) F_ The degree of multiprogramming is controlled by the short-term scheduler. (no, MPL is controlled by the long term scheduler) F_ Deadlock-free implies starvation-free T_ Starvation-free implies deadlock-free (because of no processes will ever starve, then there can't be any deadlock) F_ Threads share the code section, global data section, and registers. (threads all have their own copy of the registers that they save as part of their state) F_ In preemptive CPU scheduling, a process is always stopped during its CPU burst and forced to give up the processor to another process. (no, b/c it might finish it's CPU burst before the scheduler forces it to stop for another process) F_ A cycle in the resource allocation graph implies that deadlock has occurred. (no, it is a necessary condition, but not sufficient. It is only sufficient in the case where all resource types only have one instance, therefor this statement is not always true, so it is false) T_ Deadlock avoidance requires a priori knowledge of processes' resource requirements (it needs to know the max resource usages of the process to be able to successfully grant requests that guarantee that no deadlock will occur) F_ Non-preemptive CPU scheduling is used when a process switches from the running state to the ready state. (because the only reason that a process would switch from the running state to the ready state is because it was stopped before it finished it CPU burst, which is what a preemptive scheduler would do) F_ In shortest remaining time first scheduling, the long-term scheduler requires an estimate of each processes next CPU burst in order to determine which process will have the shortest remaining CPU burst time. (everything is true here, except it is the short-term scheduler that it is true for) 3.) Short Answer: Briefly explain the DIFFERENCE between the two terms: (12 points) a) ready queue and wait queue ready queue is where the processes wait for access to the CPU, while the wait queue is where they wait for I/O or some other event to complete. When a process finishes its CPU burst and begins its I/O burst, it is transferred from the ready queue to the wait queue and the CPU scheduler then selects a ready process from the ready queue to run on the CPU. When a process is run. it is moved from the ready queue to the running queue. b) short-term and long-term scheduling The long-term scheduler decides which of the submitted processes to load into memory and place in the ready queue, and therefore, controls the multiprogramming level. The short-term scheduler, otherwise known as the CPU scheduler, selects a job from among the jobs waiting in the ready queue, according the governing CPU scheduling algorithm. c) response time and turnaround time Both are metrics for evaluating the performance of systems. TAT is the total time the process spends in the
d) message passing and shared memory Both are ways to share information between cooperating processes. With MP, the receiver (and sometimes the sender) must be named, either implicitly or explicitly. Messages are passed from one process to another, typically via a mail-box, although this does not have to be the case. MP is particularly useful in a distributed environment. With shared memory, the process normally have access to the same global address space, and they agree to share regions of their allotted address space with one another. In this case, the processes can simply load and store data to the same memory locations they have agreed on.
==18497== by 0x804847D: main (code.c:23) ==18497== Address 0x1B92A070 is 0 bytes after a block of size 16 alloc'd ==18497== at 0x1B9042A4: malloc (vg_replace_malloc.c:130) ==18497== by 0x804845D: main (code.c:21) ==18497== ==18497== Invalid read of size 4 ==18497== at 0x8048414: foo (code.c:14) ==18497== by 0x804847D: main (code.c:23) ==18497== Address 0x1B92A070 is 0 bytes after a block of size 16 alloc'd ==18497== at 0x1B9042A4: malloc (vg_replace_malloc.c:130) ==18497== by 0x804845D: main (code.c:21) data[4] = 4 data[0] = 0 data[1] = 1 data[2] = 2 data[3] = 3 ==18497== ==18497== Invalid write of size 4 ==18497== at 0x80483FF: foo (code.c:13) ==18497== by 0x804848C: main (code.c:24) ==18497== Address 0x1B92A0B0 is 0 bytes after a block of size 16 alloc'd ==18497== at 0x1B9042A4: malloc (vg_replace_malloc.c:130) ==18497== by 0x804846C: main (code.c:22) ==18497== ==18497== Invalid read of size 4 ==18497== at 0x8048414: foo (code.c:14) ==18497== by 0x804848C: main (code.c:24) ==18497== Address 0x1B92A0B0 is 0 bytes after a block of size 16 alloc'd ==18497== at 0x1B9042A4: malloc (vg_replace_malloc.c:130) ==18497== by 0x804846C: main (code.c:22) data[4] = 4 ==18497== ==18497== Invalid free() / delete / delete[] ==18497== at 0x1B9047A9: free (vg_replace_malloc.c:152) ==18497== by 0x804849B: main (code.c:25) ==18497== Address 0x52BFE3A8 is on thread 1's stack ==18497== ==18497== ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 13 from 1) ==18497== malloc/free: in use at exit: 32 bytes in 2 blocks. ==18497== malloc/free: 3 allocs, 2 frees, 40 bytes allocated. ==18497== For counts of detected errors, rerun with: -v ==18497== searching for pointers to 2 not-freed blocks. ==18497== checked 49152 bytes. ==18497== ==18497== LEAK SUMMARY: ==18497== definitely lost: 32 bytes in 2 blocks. ==18497== possibly lost: 0 bytes in 0 blocks. ==18497== still reachable: 0 bytes in 0 blocks. ==18497== suppressed: 0 bytes in 0 blocks. ==18497== Use --leak-check=full to see details of leaked memory