Lecture 1 Flashcards
ps -A
On a Linux system, displays every active process
Parent of all processes on the system
init
systemd
launchd
How is PCB implemented in linux?
As the data structure task_struct
How is PCB implemented in Darwin?
As a data structure task.
What is the most complicated data structure in the operating system?
The process block
Job queue
Set of all processes in the system
Ready queue
set of all processes in main memory, ready and waiting to execute.
Device queues
set of processes waiting for a particular I/O device
Scheduling
used to determine which process is next to get access to CPU.
How are queues implemented?
As a doubly linked list of PCBs
What are the reasons for cooperating processes? (IPC)
- Computation speedup (parallelization)
- Information sharing
- Modularity
What are the two models of IPC?
- Shared memory
2. Message passing
Example of shared memory in Unix
POSIX shared memory Unix
How does a process terminate another process?
Via a System call
TerminateProcess() in windows
abort() in Unix/Linux
How does a parent know which child to terminate?
The child id is passed to the parent when the child is created.
Does the OS allow a child to continue if its parent terminates?
NO
The process is a Zombie when?
No parent waiting, hasn’t invoked wait() yet.
A process is an orphan when?
Parent terminates without invoking wait().
ps -ef
In Linux will display kernal threads
Parent of all other kernel threads?
kthreadd (pid = 2)
Examples of message passing
Windows advanced local procedure (ALPC) facility Pipes (named or unnamed) Client-server communication - Sockets - Remote Procedure Calls (RPCs)
What are the reasons a parent might terminate a child process?
Child has exceeded allocated resources
Task assigned to child is no longer required
The parent is exiting and the operating systems does not allow a child to continue if its
parent terminates
On UNIX systems what happens to orphaned processes?
They are inherited by process with pid 1 which then proceeds to kill them.