How OS manages multitasking and resource allocation (A1.3 Operating systems and control systems)

0.0(0)
studied byStudied by 1 person
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/16

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

17 Terms

1
New cards

Multitasking

Execute multiple tasks seemingly simultaneously by quickly switching between processes

2
New cards

Resource allocation

Each task receives necessary resources (CPU time, memory, I/O devices) to execute properly

3
New cards

I. Task scheduling

Scheduler decides order in which processes are executed to maximize CPU utilization and system responsiveness

4
New cards

II. Resource contention

Multiple processes compete for same resources so must manage contention = prevent conflicts, ensure fair and efficient resource usage

5
New cards

Semaphore (RESOURCE CONTENTION TOOL)

Synchronization tool to control access to shared resources in concurrent system (multiple processes can access same resources)

- Integer variable that can be incremented (signal) or decremented (wait) automatically

- Prevents data corruption (multiple processes write to same log file which can't handle all of them)

- 2 types

6
New cards

Semaphore type: Binary/mutex (RESOURCE CONTENTION TOOL)

Can only be 0 (locked) or 1 (available), lock to ensure mutual exclusion

7
New cards

Semaphore type: Counting (RESOURCE CONTENTION TOOL)

Can be any non-negative value, allowing multiple instances of resources to be managed (decrease by 1 everytime its accessed by a process, other processes must wait if it goes to 0)

8
New cards

Lock (RESOURCE CONTENTION TOOL)

Ensures only one process can use shared resource as time

- Different types: binary locks (mutexes), readers-writer locks (multiple may read but only one can write)

9
New cards

Monitor (RESOURCE CONTENTION TOOL)

Manages access to shared resources safely = only one process can use certain variables at a time

- Like a container holding shared variables (metadata - data about the data like access date and time, etc) and code (methods) that work with them

- Process uses a monitor's method = automatically locks the monitor so no other process can use until the first one is done

- Has condition variables that let processes wait for certain events to happen and notify others when they occur

= easier to manage and coordinate tasks between different processes safely

10
New cards

III. Deadlock prevention

To ensure availability and protection of resources and data, and reliability of execution through avoiding indefinite blockinb

Deadlock - multiple processes stuck forever, each waiting for other's resources

11
New cards

Deadlock avoidance (DEADLOCK PREVENTION)

(eg Banker's algorithm) System only allocates resources if it can guarantee that all processes can eventually finish without entering unsafe state

12
New cards

Deadlock detection (DEADLOCK PREVENTION)

Regularly check for stuck processes

13
New cards

Deadlock recovery (DEADLOCK PREVENTION)

Stop process/es to break the cycle or reallocate resources differently

14
New cards

Pre-empt resources (DEADLOCK PREVENTION)

Requeue processes/resources

15
New cards

Rollback (DEADLOCK PREVENTION)

Restore to a previous state

16
New cards

IV. Manage context-switching efficiently

Context-switching - shifting between processes

- ^ context switches = ^ processing overheads (consuming resources not related to direct goal) = v overall system performance

17
New cards

V. Ensure data consistency and integrity

Essential when multiple processes access shared data (see Security function of OS)

Explore top flashcards

Medical terma quiz 4
Updated 409d ago
flashcards Flashcards (44)
Skull
Updated 5h ago
flashcards Flashcards (47)
Integrals
Updated 665d ago
flashcards Flashcards (41)
Ch13-14 Civics
Updated 1034d ago
flashcards Flashcards (45)
List 35
Updated 1098d ago
flashcards Flashcards (35)
Medical terma quiz 4
Updated 409d ago
flashcards Flashcards (44)
Skull
Updated 5h ago
flashcards Flashcards (47)
Integrals
Updated 665d ago
flashcards Flashcards (41)
Ch13-14 Civics
Updated 1034d ago
flashcards Flashcards (45)
List 35
Updated 1098d ago
flashcards Flashcards (35)