Operating Systems Midterm 1

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/204

encourage image

There's no tags or description

Looks like no tags are added yet.

205 Terms

1
New cards

What is a process in an operating system?

A program in execution that includes its code, data, stack, and current state.

2
New cards

What are the main components of a process?

Code, data, stack, program counter, and CPU registers.

3
New cards

What triggers process creation?

System calls like fork() or exec() initiated by the OS or user.

4
New cards

What is process termination?

When a process finishes execution and releases system resources.

5
New cards

What is multiprogramming?

Running multiple processes concurrently on a single CPU for efficiency.

6
New cards

Why is concurrency important?

It allows overlapping of I/O and computation for better resource use.

7
New cards

What is the difference between concurrency and parallelism?

Concurrency interleaves tasks; parallelism runs them simultaneously.

8
New cards

What is the Process Control Block (PCB)?

A data structure storing all info about a process (state, registers, memory, etc.).

9
New cards

What are the five main process states?

New, Ready, Running, Waiting (Blocked), Terminated.

10
New cards

What transitions a process from Ready to Running?

The CPU scheduler dispatches it to execute.

11
New cards

What causes a process to move from Running to Waiting?

An I/O request or blocking event.

12
New cards

What causes a process to move from Running to Ready?

A timer interrupt or preemption.

13
New cards

What is context switching?

Saving one process's state and loading another's to switch execution.

14
New cards

Why is context switching costly?

It consumes CPU cycles but performs no useful computation.

15
New cards

What is interprocess communication (IPC)?

A mechanism allowing processes to share data or signals.

16
New cards

What are the two IPC models?

Shared memory and message passing.

17
New cards

What is shared memory IPC?

Processes share a region of memory and coordinate with synchronization.

18
New cards

What is message passing IPC?

Processes exchange messages through OS-managed send/receive calls.

19
New cards

When is shared memory preferred?

When high data volume and efficient synchronization are possible.

20
New cards

What is a pipe?

A unidirectional channel for communication between related processes.

21
New cards

What is a named pipe?

A pipe accessible via the file system for unrelated processes.

22
New cards

What are signals?

Software interrupts used to notify a process of an event (e.g., SIGTERM).

23
New cards

What is RPC?

Remote Procedure Call—invoking functions across machines like local calls.

24
New cards

What are IPC challenges?

Synchronization, deadlocks, and data consistency.

25
New cards

What is address translation?

Mapping logical (CPU) addresses to physical memory addresses.

26
New cards

What does the Memory Management Unit (MMU) do?

It performs address translation at runtime.

27
New cards

Why is address translation necessary?

To isolate process memory and support virtual addressing.

28
New cards

What is process isolation?

Preventing processes from accessing each other's memory space.

29
New cards

What is the benefit of process isolation?

Improves system stability and security.

30
New cards

What is process hierarchy?

Parent-child process relationships (UNIX fork-exec model).

31
New cards

What does fork() do?

Creates a new child process identical to the parent.

32
New cards

What does exec() do?

Replaces a process's memory with a new program.

33
New cards

What happens when a parent terminates before a child?

The child becomes an orphan, adopted by init/systemd.

34
New cards

What are zombie processes?

Finished processes still occupying a table entry.

35
New cards

Why do zombie processes occur?

The parent hasn't yet read their exit status.

36
New cards

What is process scheduling?

Selecting which process gets CPU time next.

37
New cards

Why does single-CPU scheduling matter?

Only one process runs at a time; others must wait.

38
New cards

What is process starvation?

When low-priority processes never get CPU time.

39
New cards

How can starvation be prevented?

Using aging to gradually increase waiting process priority.

40
New cards

What is process synchronization?

Coordinating access among processes sharing resources.

41
New cards

What is a thread?

A lightweight unit of execution within a process sharing memory.

42
New cards

How do threads differ from processes?

Threads share code/data; processes have separate memory.

43
New cards

What does each thread maintain?

Its own program counter, registers, and stack.

44
New cards

Why use threads?

They improve responsiveness and efficiency by overlapping tasks.

45
New cards

What is a multithreaded process?

A process with multiple threads executing concurrently.

46
New cards

What are the two main thread types?

User-level threads and kernel-level threads.

47
New cards

What is a user-level thread?

Managed in user space without kernel involvement.

48
New cards

What is a kernel-level thread?

Managed directly by the OS scheduler.

49
New cards

What are advantages of user-level threads?

Fast switching and low overhead.

50
New cards

What are disadvantages of user-level threads?

If one thread blocks, the whole process blocks.

51
New cards

What is the advantage of kernel-level threads?

Each thread can be scheduled independently.

52
New cards

What is the disadvantage of kernel-level threads?

Higher overhead due to system calls.

53
New cards

What is a hybrid threading model?

Maps many user threads to fewer kernel threads (M:N).

54
New cards

How does thread context switching compare to process switching?

Thread switches are faster due to shared address space.

55
New cards

What is concurrency in threading?

Interleaved thread execution for shared progress.

56
New cards

What is parallelism in threading?

Actual simultaneous execution on multiple cores.

57
New cards

What is thread synchronization?

Coordinating threads accessing shared data to prevent conflicts.

58
New cards

Why is synchronization important in threads?

It prevents race conditions.

59
New cards

What is a race condition?

When output depends on the unpredictable order of execution.

60
New cards

What is thread safety?

Ensuring shared data access doesn't produce errors.

61
New cards

What is a critical section?

A part of code that must not be executed by multiple threads at once.

62
New cards

What are common synchronization primitives?

Locks, semaphores, and monitors.

63
New cards

What is thread pooling?

Reusing a fixed set of threads to handle multiple tasks.

64
New cards

What is the benefit of thread pooling?

Reduces overhead from thread creation/destruction.

65
New cards

What is thread scheduling?

Deciding which thread runs next on a core.

66
New cards

What happens if the main thread terminates?

Depending on design, all threads may terminate.

67
New cards

What is a daemon thread?

A background thread that ends when the process exits.

68
New cards

What is thread priority?

A value determining thread scheduling order.

69
New cards

How do user and kernel-level scheduling differ?

User-level libraries schedule within a process; kernel schedules system-wide.

70
New cards

What is thread blocking?

When a thread waits for I/O or synchronization.

71
New cards

What causes thread deadlocks?

Improper resource acquisition order among threads.

72
New cards

What is thread yield?

Voluntarily giving up CPU to allow other threads to execute.

73
New cards

What is context switch overhead for threads?

Low, since memory space is shared.

74
New cards

What are benefits of multithreading?

Responsiveness, resource sharing, and performance.

75
New cards

What is a drawback of multithreading?

Harder debugging and risk of synchronization errors.

76
New cards

Why is multithreading beneficial for servers?

It allows concurrent request handling efficiently.

77
New cards

What happens in thread synchronization failure?

Data inconsistency or crashes.

78
New cards

What is CPU scheduling?

Deciding which process gets the CPU next.

79
New cards

What are the main scheduling goals?

Maximize CPU utilization, throughput, and fairness; minimize waiting and response time.

80
New cards

What is turnaround time?

Total time from submission to completion.

81
New cards

What is waiting time?

Time spent in the ready queue.

82
New cards

What is response time?

Time from request to first CPU response.

83
New cards

What is throughput?

Number of processes completed per unit time.

84
New cards

What is CPU utilization?

Percent of time CPU is doing useful work.

85
New cards

What are process states?

New, Ready, Running, Waiting, Terminated.

86
New cards

What triggers scheduling?

Process creation, termination, or I/O completion.

87
New cards

What is preemptive scheduling?

Processes can be interrupted for higher-priority ones.

88
New cards

What is non-preemptive scheduling?

Processes run to completion before switching.

89
New cards

Why use preemptive scheduling?

Improves responsiveness.

90
New cards

Why use non-preemptive scheduling?

Simpler and lower overhead.

91
New cards

What is dispatcher latency?

Time to switch from one process to another.

92
New cards

What is FCFS scheduling?

First Come, First Served—non-preemptive.

93
New cards

What is a drawback of FCFS?

Long jobs delay short ones (convoy effect).

94
New cards

What is SJF scheduling?

Shortest Job First—executes process with smallest CPU burst.

95
New cards

Why is SJF optimal?

Minimizes average waiting time.

96
New cards

What is the limitation of SJF?

Requires predicting CPU burst time.

97
New cards

What is SRTF scheduling?

Shortest Remaining Time First—preemptive version of SJF.

98
New cards

What is Priority Scheduling?

Runs the highest-priority process first.

99
New cards

What problem arises in Priority Scheduling?

Starvation of low-priority processes.

100
New cards

What prevents starvation?

Aging (increasing waiting process priority).