Академический Документы
Профессиональный Документы
Культура Документы
REVIEW QUIESTIONS.
Communication - There are many circumstances in which one process needs to exchange information with another
process. Such communication may occur between processes that are executing on the same computer or between
processes that are executing on different computer systems tied together by a computer network. Communications may
be implemented via shared memory, in which two or more processes read and write to a shared section of memory, or
message passing, in which packets of information in predefined formats are moved between processes by the operating
system.
Error Detection - The operating system needs to be detecting and correcting errors constantly. Errors may occur in the
CPU and memory hardware (such as a memory error or a power failure), in I/O devices (such as a parity error on disk, a
connection failure on a network, or lack of paper in the printer), and in the user program (such as an arithmetic
overflow, an attempt to access an illegal memory location, or a too-great use of CPU time).
6. What are the two basic goal groups that must be considered when designing an operating system?
User goals and System goals
User goals – operating system should be convenient to use, easy to learn, reliable, safe, and fast.
System goals – operating system should be easy to design, implement, and maintain, as well as flexible, reliable,
error-free, and efficient.
7. Name at least two activities the operating system is responsible for in connection with disk management.
Free space management.
Storage allocation.
Disk scheduling.
8. What is the name of the small piece of code that locates the kernel and loads it into main memory?
Bootstrap program or bootstrap loader.
When CPU switches to another process, the system must save the state of the old process and load the saved state for
the new process via a context switch
3. With the aid of a neat diagram explain the set of process states in Sequence.
UNIX Process Creation. UNIX fork() creates a process. Creates a new address space. Copies text, data, & stack into new
address space. Provides child with access to open files. UNIX exec() allows a child to run a new program. UNIX wait()
allows a parent to wait for a child to terminate.
The process is created by fork () system call. Fork () creates a new process from the existing process. The existing process
from which function called is known as parent process and newly created process is known as child process. Child
process has its own process ID. Fork ( ) takes no argument and return process ID. If successfully fork ( ) system call run, it
returns twice.
Independent &
Cooperating
6. What is the function of the two system calls used with message-passing systems?
send() &
receive()
Unnamed pipes – Unnamed pipes allow separate processes to communicate without having been designed explicitly to
work together. This allows tools quite narrow in their function to be combined in complex ways.
Name pipes – is sometimes called a FIFO. FIFO stands for “First In, First Out” and refers to the property that the order of
bytes going in is the same coming out.
Threads (of the same process) run in a shared memory space, while processes run in separate memory spaces.
A process is an executing instance of a program. A thread is a path of execution within a process.
E.g. when you start Word, the operating system creates a process and begins executing the primary thread of that
processes.
Specifying the number of threads used by the Web server. An HTTP request is processed by a thread. A thread, in turn,
can handle a number of network connections. You can specify the number of threads the Web server can process
Responsiveness – may allow continued execution if part of process is blocked, especially important for user interfaces.
Resource Sharing – threads share resources of process, easier than shared memory or message passing.
Economy – cheaper than process creation, thread switching lower overhead than context switching.
Scalability – process can take advantage of multiprocessor architectures.
4. Explain the difference, using examples, between concurrent execution on a single core system and parallel execution on a multi-
core system.
Concurrent execution on a single core system – The switching between threads happens quickly enough that the
threads might appear to run simultaneously but the threads are not actually running simultaneously
Parallel execution on a multi-core system – Each thread in the process can run concurrently on a separate processor,
resulting in parallel execution, which is true simultaneous execution.
5. Explain the difference, using examples, between Data parallelism and Task parallelism.
Data parallelism – distributes subsets of the same data across multiple cores, same operation on each.
Task parallelism – distributing threads across cores, each thread performing unique operation.
6. Discuss the difference between user level threads and kernel level threads, and how they can be related.
Linked file – a linked file can appear in two or more directories with each directory maintain a pointer to the file, thus allowing
multiple users to access