- Process (תהליך): an executing instance of a program, with its own memory space.
-
Child Process (CP): processes created by another (parent) process.
-
Thread (תהליכון): the smallest unit of execution within a process.
- Multithreading (ריבוי תהליכונים): A CPU feature that enables the processor to maintain the state of multiple threads and rapidly alternate between them on a nanosecond scale.
- This mechanism improves the utilization of execution units during stalls (such as memory latency), but it does not provide genuine parallelism, as only one thread is actively executing at any given moment.
- Multithreading (ריבוי תהליכונים): A CPU feature that enables the processor to maintain the state of multiple threads and rapidly alternate between them on a nanosecond scale.
-
-
context switch is performing a state save of the current process and a state restore of a different process. switching the CPU core to another process
-
the process table
- data structure used by the OS to manage processes.
- an array of structures
- one entry per process
-
a process control block (PCB) (or task control block)
- Each process is represented in the OS by a PCB
- contains: process’ state, including its program counter, stack pointer, memory allocation, the status of its open files, its accounting and scheduling information,
-
Timesharing (חלוקת זמן): CPU time is divided among multiple users or processes.
-
Batch System (מערכת אצווה): executes jobs in batches with minimal user interaction.
-
Multiprogramming (ריבוי תוכניות): multiple programs reside in memory to improve CPU utilization.
-
Kernel (גרעין): the core part of the OS managing resources and hardware.
-
Kernel Mode (מצב ראשוני): CPU mode with full access to hardware and memory.
-
User Mode (מצב משתמש): restricted CPU mode for running user applications.
-
System Call (קריאת מערכת): interface for user processes to request OS services.
-
UID (User Identification): numeric ID assigned to a user for permission control.
-
GID (Group Identification): numeric ID assigned to a group of users.
-
Address Space: the memory range a process can access.
-
Command Interpreter: program that reads and executes user commands (e.g., shell).
-
Core Image: memory snapshot of a process, including code and data.
-
File Descriptor: integer handle used to access open files in a process.
- Virtual memory
Interrupts
- interrupt (פסיקה)
- An interrupt request (or IRQ) is a signal to the CPU to stop and handle an event.
- are the interrupt numbers
- Hardware interrupts generated by hardware devices external to the CPU
- Software interrupt (or trap) is a software-generated interrupt.
- It can be caused by: error, system call instruction,
- (e.g. in x86, 0–31 are CPU exceptions, 32-47 hardware interrupts and 48–255 software interrupts)
- Interrupt vector table (IVT) is a list of interrupt vectors, where the th interrupt vector is an address points to the th ISR.
- interrupt handler, aka interrupt service routine (ISR),
Linux
-
The kernel and user use the term PID differently:
- (kernel view) Each thread has its own ID called PID (sometime called thread ID (TID)).
- (user view) PID of process refers to the TGID
-
A thread group is a collecation of threads sharing the same thread group ID (TGID)
- The first thread in a procces is called the thread group leader, and it has TGID the same as its (kernel) PID. The other thread will have TGID the same as the TGID of the thread group leader.
- the TGID is the same as the PID of the procces of the theards.
- each thread has its own
struct task_struct *task. - each thread has its own (kernel) PID (=TID).
- (kernel)
pid_t task->pid. - (user)
syscall(SYS_gettid).
- (kernel)
- all threads have the same TGID.
- (kernel)
pid_t task->tgid - (user)
getpid().
- (kernel)
- all threads have the same PPID. (using
pid_t getppid())
-
A process group is a set of one or more processes sharing the same process group ID (PGID,
pgid), (which is a number of typepid_t).- a process group groups processes (not threads)
- a process group has a process group leader, which is the process that creates the group and whose PID becomes the PGID of the group.
- A new process inherits its parent’s process group ID.
job control
- A session is a collection of process groups (jobs)
- All of the processes in a session have the same session identifier.
- A session leader is the process that created the session, and its process ID becomes the session ID.