Section 1

Preview this deck

What is a race condition?

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (42)

Section 1

(42 cards)

What is a race condition?

Front

A race condition is a situation in which two (or more) processes are about to perform some action involving some shared data. Depending on the exact timing, one or the other goes first. If one of the processes goes first, everything works, but if another one goes first, a fatal error occurs

Back

T/F: External fragmentation is problem with segmented virtual memory

Front

True

Back

Explain the difference between internal fragmentation and external fragmentation. Which one occurs in paging systems? Which one occurs in systems using pure segmentation?

Front

* Internal fragmentation occurs when the last allocation unit is not full * External fragmentation occurs when space is wasted between two allocation units * In a paging system, the wasted space in the last page is lost to internal fragmentation * In a pure segmentation system, some space is invariably lost between the segments. This is due to external fragmentation.

Back

What is true of User level threads?

Front

* There is great flexibility in thread scheduling policies * Thread run-time support is needed to route incoming signals to the correct thread * Threaded programs are easily ported to other systems

Back

What is a trap instruction? Explain its use in operating systems

Front

A trap instruction is kernel-mode set of instructions which causes a switch from user mode to kernel mode, starting execution at a fixed address in the kernel. The trap instruction transfers control to the operating system which carries out system calls before returning control to the instruction following the system call. The trap instruction is like the call instruction because the instruction following it is taken from a distant location, and the return address is saved on the stack for later use

Back

What is the difference between kernel and user mode?Explain how having two distinct modes aids in designing an operating system

Front

Most modern CPUs provide two modes of execution: kernel mode and user mode. The CPU can execute every instruction in its instruction set and use every feature of the hardware when executing in kernel mode. However, it can execute only a subset of instructions anduse only subset of features when executing in the user mode. Having two modes allows designers to run user programs in user mode and thus deny them access to critical instructions

Back

What is the purpose of a system call in an operating system? Give examples of system calls

Front

A system call allows a user process to access and execute operating system functions inside the kernel. User programs use system calls to invoke operating system services. fork: a (UNIX)system call used for creating child processes. open:a system call used for initializing access to a file. kill:a (UNIX)system call used for terminating a process

Back

How does superscalar architecture affect interrupt handling? Explain and compare to pipelined architectures

Front

Superscalar architecture is a method of parallel computing used in many processors. In a superscalar computer, the central processing unit (CPU) manages multiple instruction pipelines to execute several instructions concurrently during a clock cycle. This is achieved by feeding the different pipelines through a number of execution units within the processor. To successfully implement a superscalar architecture, the CPU's instruction fetching mechanism must intelligently retrieve and delegate instructions. Otherwise, pipeline stalls may occur, resulting in execution units that are often idle. For superscalar architecture, the CPU must carefully manage the order in which it processes instructions

Back

How does use of cache memory benefit multi core systems? How does it complicate them?

Front

In a multi core system, each CPU core has its own cache memory. Cache memory holds frequently used instructions/data which the processor may require next and it is faster access memory than RAM, since it is on the same chip as the processor. This reduces the need for frequent slower memory retrievals from main memory, which may otherwise keep the CPU waiting. The more cache the CPU has, the less time the computer spends accessing slower main memory and as a result programs may run faster.

Back

Suppose that there are five jobs which arrive at a batch processing center at times 0, 1,3, 5, and 8. And they have computer times 6, 4, 3, 2, and 1. For SRTF/CTSS/SJF/FCFS/RR(2) scheduling, which job finishes first? What runs for the 9th time slot?

Front

Back

Compare and contrast a Pipelined system with a non-pipelined system

Front

PIPELINING SYSTEM: -Pipelining is an implementation technique where multiple instructions are overlapped in execution. -It has a high throughput (amount of instructions executed per unit time). -In pipelining, many instructions are executed at the same time and execution is completed in fewer cycles. -The pipeline is filled by the CPU scheduler from a pool of work which is waiting to occur. Each execution unit has a pipeline associated with it, so as to have work preplanned. -The efficiency of the pipelining system depends upon the effectiveness of CPU scheduler. NON- PIPELINING SYSTEM: -All the actions (fetching, decoding, executing of instructions and writing the results into the memory) are grouped into a single step. -It has a low throughput. -Only one instruction is executed per unit time and execution process requires more number of cycles. -The CPU scheduler in the case of non-pipelining system merely chooses from the pool of waiting work when an execution unit gives a signal that it is free. -It is not dependent on CPU scheduler.

Back

Multithreading is the best choice for...

Front

* when a server has a number of distinct tasks to be performed concurrently on shared data * when a server must make a variable number of requests concurrently depending on user input, a server has to be able to receive requests at the same time it waits for a response to request

Back

T/F: The minimum allocation of page frames in a paged virtual memory system depends on the machine instruction set

Front

True?

Back

T/F: Protection of memory access is not needed in monogramming environments

Front

False

Back

Instructions to be executed by a process are located in its ____ segment

Front

Text (or code)

Back

List four conditions that are necessary for multiple processes to cooperate correctly and efficiently using shared data

Front

1. No two processes may be simultaneously inside their critical sections. 2. No assumptions may be made about speeds or the number of CPUs. 3. No process running outside its critical section may block other processes. 4. No process should have to wait forever to enter its critical section

Back

Processes are created using the _____ system call

Front

fork

Back

If the cache access time is 3 ns, and RAM access time is 100 ns, what is the effective mean access time in ns if the cache has a hite rate of 80%

Front

22.4

Back

What are allocated on a per-THREAD basis?

Front

program counter, execution stack

Back

What is a process? What does a process consist of?

Front

A process is basically a program in execution. It consists of the executable program, the program's data and stack, program counter, stack pointer, and other registers and all the other information needed to run the program

Back

T/F: Which type of memory management makes allocation and free space management easiest?

Front

Paging

Back

What are the main differences between a PROCEDURE call and a SYSTEM call?

Front

* the system call stores its parameters in one armor registers * the system call traps to the OS while the procedure call does not

Back

When is the binary semaphore solution to the critical section most attractive?

Front

When there is a SINGLE core and the critical section is LONG

Back

T/F: Pure pages virtual memory facilitates sharing memory

Front

False

Back

T/F: Externel fragmentation is a problem with contiguous memory allocation

Front

True

Back

What is the difference between VM/370 and the exokernel scheme?

Front

VM/370 must remap hardware resources for each virtual machine to their physical location, while this is not true in the exokernel scheme

Back

What is multiprogramming?

Front

Multiprogramming is the rapid switching of the CPU between multiple processes in memory. It is commonly used to keep the CPU busy while one or more processes are doing I/O

Back

The location of the next instruction to execute after returning from a procedure call is found in the ____ segment of a process

Front

Stack

Back

T/F: External fragmentation is a problem with paged virtual memory

Front

False

Back

What are the advantages of the client-server OS architecture?

Front

* the OS can be adapted more easily to a distributed system * if a system service fails it can be restarted without having to reboot the whole OS

Back

Key Differences Between Preemptive and Non-Preemptive Scheduling

Front

1. In preemptive scheduling the CPU is allocated to the processes for the limited time whereas in Non-preemptive scheduling, the CPU is allocated to the process till it terminates or switches to waiting state. 2. The executing process in preemptive scheduling is interrupted in the middle of execution when higher priority one comes whereas, the executing process in non-preemptive scheduling is not interrupted in the middle of execution and wait till its execution. In Preemptive Scheduling, there is the overhead of switching the process from ready state to running state, vise-verse, and maintaining the ready queue. Whereas in case of non-preemptive scheduling has no overhead of switching the process from running state to ready state. In preemptive scheduling, if a high priority process frequently arrives in the ready queue then the process with low priority has to wait for a long, and it may have to starve. On the other hands, in the non-preemptive scheduling, if CPU is allocated to the process having larger burst time then the processes with small burst time may have to starve. Preemptive scheduling attain flexible by allowing the critical processes to access CPU as they arrive into the ready queue, no matter what process is executing currently. Non-preemptive scheduling is called rigid as even if a critical process enters the ready queue the process running CPU is not disturbed. 5. The Preemptive Scheduling has to maintain the integrity of shared data that's why it is cost associative as it which is not the case with Non-preemptive Scheduling.

Back

T/F: Proection of memory access is not needed in monoprogramming environments

Front

False

Back

Describe DMA and how cache memory benefits DMA I/O

Front

DMA is a hardware device that can move to/from memory without using CPU instructions. On most DMA hardwares you can also set it up to do memory to memory transfers - there are not always external devices involved. Also depending on the system you may or may not need to sync the CPU-cache in software before (or after the transfer), since the data the DMA transfers into/from memory may be done without the knowledge of the CPU-cache. The benefit of doing any DMA is that the CPU(s) is/are able to do other things simultaneously. Of course when the CPU also needs to access the memory, only one can gain access and the other must wait. Mem to mem DMA is often used in embedded systems to increase performance, or may be vital to be able to access some parts of the memory at all. DMA and CPU-cache are totally different things and not comparable. Also, DMA controller is usually faster than CPU

Back

What characteristics are true of kernel threads?

Front

* multiple threads in the same process can be schedule on different CPUs on multicore machine * thread operations involve the operating system

Back

Programs are run by a process using the ____ system call

Front

Exec

Back

T/F: With demand paging systems, a larger allocation always means fewer page faults during process execution

Front

False?

Back

What is the difference between timesharing and multiprogramming systems?

Front

In a timesharing system, multiple users can access and perform computations on a computing system simultaneously using their own terminals. Multiprogramming systemsallow a user to run multiple programs simultaneously. All time sharing systems are multiprogramming systems but not all multiprogramming systems are timesharing systems since a multiprogramming system may run on a PC with only one user

Back

T/F: Segmented virtual memory facilitates sharing memory

Front

True

Back

What are the two main functions of an operating system?

Front

An operating system must provide the users with an extended (i.e., virtual) machine,and it must manage the I/O devices and other system resources

Back

When is the spin lock solution to the critical section problem most attractive?

Front

When there are MULTIPLE cores and the critical section is SHORT

Back

How do pipelined architectures affect interrupt handling? Explain and compare to non-pipelined architectures

Front

Pipelining attempts to keep every part of the processor busy with some instruction by dividing incoming instructions into a series of sequential steps performed by different processor units with different parts of instructions processed in parallel. An instruction may be uninterruptible to ensure its atomicity, such as when it swaps two items. A sequential processor permits interrupts between instructions, but a pipelining processor overlaps instructions, so executing an uninterruptible instruction renders portions of ordinary instructions uninterruptible too

Back

Which type of memory management facilitates sharing instructions between processes?

Front

Segmentation

Back