CSOPESY_04_processes_and_threading_wip

RAW FILE

This note has not been edited yet. Content may be subject to change.

Regarding content on this note

this is a combination of 04 - Processes and whatever slides sir used during class, as of writing (10/08/2025) sir hasn't uploaded these slides

Processes

Process Components

_attachments/Pasted image 20251008123448.png
a process is composed of several key sections:

Memory layout of a C program

_attachments/Pasted image 20251008123535.png

Process State

_attachments/Pasted image 20251008123929.png

Process Control Block (PCB)

_attachments/Pasted image 20251008124812.png

next section is Threads, Benefits of Multithreading, Multithreading Models

Process Scheduling

_attachments/Pasted image 20251008132427.png

Schedulers

Context Switch

Operations on Process

Process Creation

Process Termination

Interprocess Communication

Cooperating vs Independent Processes

Benefits of IPC

Models of Communication in IPC

_attachments/Pasted image 20251008134747.png

Communication in Client-Server Systems

Examples of IPC systems

Interprocess Communication Systems

Threads

_attachments/Pasted image 20250925112152.png
What is a thread

Thread Components

Multithreading

Thread vs Process

Why use threads

go back to this part of the recording up until multicore programming start
its easier to setup a thread than a process

Scalability

parallelism and concurrency is not the same, though parallelism is a subset of being concurrent.

Benefits of Multithreading

segue to multicore programming

Multicore Programming

_attachments/Pasted image 20250925112940.png

Multicore system vs Multiprocessor

_attachments/Pasted image 20250925113152.png

Challenges of Multicore Programming

Amdahl's Law

speedup1S+(1S)NSsequentialportionNnumberofprocess

ex.
100% program
30% remains sequential
70% is now in parallel
N = 2 processors

speedup = 1 / (0.3 + (1-0.3)/2)
speedup = 1 / (0.3 + (0.7)/2)
speedup = 1 / 0.65
speedup = 1.5 potential speedup

Multithreading Models

Types of threads:

Mapping Models

_attachments/Pasted image 20250925114611.png

Thread Libraries

Primary ways of implementing a library

Common Thread Libaries

Implicit Threading

Key Approaches:

go back to this part for extra notes

Issues in Threading

_attachments/Pasted image 20250925115314.png

Operating System Examples

_attachments/Pasted image 20250925115527.png

Code Demo - Threading

nothing here