Sample Question 8

Ace your homework & exams now with Quizwiz!

What is an exception?

- Abrupt change in control flow that happens due to a system event (in processor state).

What are differences between concurrent and sequential execution?

- Concurrent execution is when two process may execute at the same time for example given x and y processes, x and y are concurrent if and only if x begins after y begins and before y finishes. Sequential execution is when processes start after one another. No overlap.

Name two reasons to kill a processor

- If a certain event such as child terminates finish. - Another processor invokes kill.

Name classes of exception

- Interrupts: (Async), always return to the next instruction caused by external events outside of processor. I/O interrupts / CTRL+C/press hard reset button/ctrl+alt+del - Traps: (Sync), always return to the next instruction. Intentional/ system calls like breakpoint traps has special instruction. - Faults: (Sync), might return to same instruction. / unintentional /potentially recoverable / page faults - Aborts: (Sync), never returns. / not recoverable at all and unintentional/parity error

What does EXECVE do?

- Loads and runs a new program in the context of the same process. - Only return if there is an error.

What does fork do?

- Parent process creates a new children process. - Child is almost identical where it gets a copy of parent virtual address space but is separate. - Parent and Child have different PID. - Called once but returns twice. - Child fork return value is 0. - They run concurrently and shared files.

What is a signal? What are they used for?

- Signals are high level software form of ECF (exceptional control flow) and used to allow PROCESSES and the KERNEL to interrupt other processes. - A small message that notifies process of an event that has happened. It is defined by number 1-30 for it's ID. It is sent by the kernel to a certain destination of processor.

What does waitpid do?

- The process waits for its children to terminate which returns to the parent which the terminated children is then removed from the process. - It can wait for a specific children process.

What does it mean to reap a process? How is it done?

- When a child terminates for any reason, it is not removed and the parent has to reap it explicitly and it is done by passing the child exit status into the parent. - If parent terminates before reaping children then it waits until the init to reap.

What is signal handler?

- When receiving a signal from the kernel, one of the three ways to react (ignore, terminate, catch), catch will use a user-function signal handler. - Similar to the exception handler where it is used to execute something like breakpoint specific.

What is a "zombie" process?

A process that has not yet been reaped which contains system memory resources.

What does a shell do?

A shell is an interactive high level program that run other programs commanded by the user. - Reads command line then evaluate.

What is a process?

An instance of running a program.

What is difference between a background process and a foreground process?

Background: she does not wait for process to complete. Foreground: Shell waits for the process to complete (since it is front to wait or else stop it).

What is an event?

Change in state is known as Event.

What is a "context" switch?

Control flow passes between processes through use of context switch. - multitasking using high level of ECF (exceptional control flow). - processes are managed by chunk of OS code (kernel) - Kernel can schedule different process. - Change from one process (task) to another without conflicting (change when there is a n interrupt as well)

What does the exit function do?

It terminates the process and stop it permanently.

What will happen when an exception occur?

It transfers the control flow to the OS.

Do processes share the same address space and open files?

No, but due to the abstractions of processes, it makes us think that processes have their own private virtual address space.

What does it mean for a signal to be "pending" and "blocked"?

Pending: a signal that has been sent but has yet not be received. Signals are not queued; can on;t have one pending signal at a time. Blocked: a signal that has been sent but the process blocked the signal and only way to be unblock is by processor.

What does wait do?

Same as waitpid but can not wait for a specific PID.

What does the kill function do?

Sends a signal to process or process group for it to terminate.

What is a context of a process?

The state that the processor need to run the program correctly.

What is exception table?

This is a jump table, it holds entries where entry k contains the address to exception handler k.

What is exception handler?

This is a system subroutine and designed to "handle" process this event.

What is an exception number?

This is an unique non-negative number: - Assigned to possible exception. - are assigned either by the DESIGNER of PROCESSOR OR the KERNEL (memory part of OS)


Related study sets

Chapter 17 - cardiac muscle tissue anatomy and electrophysiology

View Set

6.6 - Hormones, homeostasis and reproduction

View Set

6 characteristics of a market economy

View Set

Chapter 15, Stockholder's Equity Key Terms

View Set

Spanish 2 Clothes- Danica Williams

View Set

ID Ch 22 Background & Antibacterials

View Set

Accounting 2: Exam 2 (Ch. 6 & 7)

View Set