OS Test 2- Chap 3

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

What are the basic components of a PCB (Process Control Block)

(Page 108) 1: Process state- state may be new, ready, running waiting, halted and so on 2: Process number 3: Program Counter 4: Registers 5: Memory limits 6: List of open files

Short Term Scheduler

(a.k.a. CPU scheduler) selects from among the processes that are ready to execute and allocates the CPU to them

Process Control Block (PCB)

(a.k.a. Task control block) contains many pieces of information associated with a specific process. role of the PCBs is central in process management: they are accessed and/or modified by most OS utilities, including those involved with scheduling, memory and I/O resource access and performance monitoring.

What is the operating systems responsible for as far as process and thread management goes?

1: Creation and deletion of both user and system processes 2: Scheduling of processes 3: Provision of mechanisms for synchronization, communication, and deadlock handling for processes

What are three ways a communication link could be implemented?

1: Direct or indirect communication 2: Synchronous or asynchronous communication 3: Automatic or explicit buffering

What are 4 reasons for providing an environment that allows process cooperation?

1: Information sharing- must provide an environment to allow concurrent access to information such as a shared file, etc. 2: Computation Speedup- If we want a particular task to run faster, we must break it into subtasks, each of which will be executing in parallel with the others 3: Modularity- We may want to construct the system in a modular fashion, dividing the system functions into separate processes or threads 4: Convenience- must allow the user to be able to work on many tasks at the same time

What happens when a context switch occurs?

1: Kernel saves the context of the old process in the PCB 2: Loads the saved context of the new process scheduled to run 3: Execute for a period of time 4: Kernel saves the context of the old process in the PCB 5: Loads the saved context of the new process scheduled to run etc.

Describe the components of the state change movement diagram

1: New processes are ADMITTED to the ready state 2: Ready processes are DISPATCHED to the running state 3: Running processes are EXITED to the terminated state 4: Running processes are INTERRUPTED into the ready state 5: Waiting processes COMPLETE I/O OR WAIT to re-enter the ready state

List the components of the state process model

1: New- the process is being created 2: Running- instructions are being executed 3: Waiting- the process is waiting for some event to occur 4: Ready- the process is waiting to be assigned to a processor 5: Terminated- the process has finished execution

List three reasons that a parent may terminate the execution of one of its children?

1: The child has exceeded its usage of some of the resources that it has been allocated 2: The task assigned to the child is no longer required 3: The parent is exiting, and the operating system does not allow a child to continue if its parent terminates

What are the two address-space possibilities for a new process?

1: The child process is a duplicate of the parent process 2: The child process has a new program loaded into it

When a process creates a new process, what two possibilities for execution exist?

1: The parent continues to execute concurrently with its children 2: The parent waits until some or all of its children have terminated

What are the events that could occur when a process is allocated the CPU and is executing?

1: The process could issue an I/O request and then be placed in an I/O queue 2: The process could create a new child process and wait for the child's process termination 3: The process could be removed forcibly from the CPU, as a result of an interrupt, and be put back in the ready queue

What are the three ways a temporary queue can be implemented (for messages exchanged by communicating processes)?

1: Zero capacity- the queue has a maximum length of zero; thus, the link cannot have any messages waiting in it. In this case, the sender must block until the recipient receives the message 2: bounded capacity- the queue has finite length. If the link is full, the sender must block until space is available in the queue 3: Unbounded capacity- the queue's length is potentially infinite; thus, any number of messages can wait in it. The sender never blocks

Orphan child processes

A child process whose parent did not invoke wait() and instead terminated

What are the basic components of a process queue?

A linked list of PCBs

Ready Queue

A list containing the processes that are residing in main memory that are ready and waiting to executed (generally stored as a linked list)

Zombie process

A process that has terminated, but whose parent has not yet called wait()

What is the producer-consumer problem?

A producer process produces information that is consumed by a consumer process. One solution to this is to use shared memory, allowing a producer to produce one item while the consumer is consuming another item. The producer and consumer must be synchronized, so that the consumer does not try to consume an item that has not yet been produced.

Process

A program in execution

Swapping

A scheme in which a process is swapped out, and is later swapped in, by the medium-term scheduler

Sockets

An endpoint for communication. Identified by an IP address concatenated with a port number.

Process identifier

An integer number that provides a unique value for each process in the system. Can be used as an index to access various attributes of a process within the kernel.

What are blocking and nonblocking message passing systems?

Blocking send: The sending process is blocked until the message is received by the receiving process or by the mailbox Blocking receive: The receiver blocks until a message is available Nonblocking send: The sending process sends the message and resumes operation Nonblocking receive: The receiver retrieves either a valid message or a null

What are buffered and unbuffered message passing systems?

Buffered- use a queue to receive multiple items in a row Unbuffered- one end has to be actively listening because it's not going to be stored

What resources do processes need?

CPU time, memory, files, and I/O devices

Job queue

Consists of all processes in the system

What is process Scheduling?

Deciding what processes get system resources when

What are direct and indirect message passing systems?

Direct communication: Each process that wants to communicate must explicitly name the recipient or sender of the communication Indirect communication: The messages are sent to and received from mailboxes or ports

The more complex the operating system, the ____ the amount of work that must be done during a context switch.

Greater

Cascading termination

Happens when a process terminates, then all its children must also be terminated as well

Context-switch times are highly dependent on ____ _____.

Hardware support

What two things can most processes be described as?

I/O bound (spends most of its time doing I/O rather than computations) or CPU bound (generates I/O requests infrequently, using more of its time doing computations)

What makes a process a cooperating one?

If it can affect or be affected by the other processes in a cooperating process

What makes a process independent?

If it cannot affect or be affected by the other processes executing in the system

CPU-Scheduling Information

Includes a process priority, pointers to scheduling queues, and any other scheduling parameters

Accounting Information

Includes the amount of CPU and time used, real time limits, account numbers, job or process numbers, and so on.

I/O Status Information

Includes the list of I/O devices allocated to the process, a list of open files, and so on

What is the difference between the short term and long term schedulers?

It lies in frequency of execution. The short-term scheduler must select a new process for the CPU frequently, while the long-term scheduler executes much less frequently.

What does it mean when by a "process has been dispatched?"

It means that after waiting in the ready queue, a process is selected for execution

How can you compute a context switch's overhead?

It varies from machine to machine. It depends on- 1: The memory speed 2: The number of registers that must be copied 3: The existence of special instructions

Memory Management information

May include such items as the value of the base and limit registers and the page tables, or the segment tables, depending on the memory system used by the operating system.

How many processes can be running on a processor at any instant?

One

Context-switch time is pure ____.

Overhead, because the system does no useful work while switching

Unbounded Buffer

Places no practical limit on the size of the buffer. Consumer may have to wait for new items, but the producer can always produce new items.

Message Passing

Provides a mechanism to allow processes to communicate and to synchronize their actions without sharing the same address space

State Save

Saves the current state of the CPU, be it in kernel or user mode

Process Scheduler

Selects an available process (possibly from a set of several available processes) for program execution on the CPU.

Long term scheduler

Selects processes from a poll of processes waiting for later execution and loads them into memory for execution

Remote Procedure Calls

Send a function to server and say "Execute this."

What are methods for interprocess communication?

Shared memory (pipes) or message passing

As a process executes, it changes ___.

State

What are synchronous and asynchronous message passing systems?

Synchronous- there has to be a block on both ends and the message has to be fully sent/received on either end Asynchronous- don't need a blocking call. You can just send it and let it go.

Program Counter

The counter indicates the address of the next instruction to be executed for this process

Medium-term Scheduler

The idea behind them is that sometimes it can be advantageous to remove a process from memory and thus reduce the degree of multiprogramming. Later, the process can be reintroduced in memory, and its execution can be continued where it left off.

Degree of multiprogramming

The number of processes in memory

CPU Registers

The registers vary in number and type. They include accumulators, index registers, stack pointers, and general-purpose registers, plus any condition-code information. This state information (along with program counter) must be saved when an interrupt occurs, to allow the process to be continued correctly afterward.

Client Server communication

The server waits for incoming client requests by listening to a specified port. Once a request is received, the server accepts a connection from the client socket to complete the connection.

Process State

The state may be new, ready, running, waiting, halted, and so on

What is a context switch?

The task of performing a state save of the current process and a state restore of a different process while switching the CPU to another process.

What is the objective of multiprogramming?

To have some process running at all times, to maximize CPU utilization

When does a process terminate?

When it finishes executing its final statement and asks the operating system to delete it by using the exit() system call.

Do most modern operating systems support processes that have multiple threads?

Yes, although traditionally, a process contained only a single thread of control as it ran

Shared memory

a region of memory that is shared by cooperating processes is established. Processes can then exchange information by reading and writing data to the shared region.

Bounded Buffer

assumes a fixed buffer size. In this case, the consumer must wait if the buffer is empty, and the producer must wait if the buffer is full.

Message Passing

communication takes place by means of messages exchanged between the cooperating processes

A batch system executes ___, whereas a time-shared system has ____.

jobs, user programs (tasks)

A program is a ____ entity, while a process is a ____ entity.

passive, active

Text Section

program code

State Restore

resumes operations


Set pelajaran terkait

Data Resource Management Exam 1 Chapter 5

View Set

Human Capital: INVESTMENTS (Before Midterm)

View Set

Life Insurance Quiz Practice Questions

View Set