what is a virtual processor?
is a simulated processor built on top of the physical processor by the OS
what is a processor?
provides instructions along with the capability to execute them
what is a thread?
a single path of execution in a process. a process can contain multiple threads
what is a process?
a program in execution that can execute 1 or more threads
what are benefits of multithreading?
what things is a process made up of?
how is pid determined?
A process can determine:
- its own pid - pid_t getpid (void);
- pid of its parents - pid_t getppid (void);
how is pid determined?
A process can determine:
- its own pid - pid_t getpid (void);
- pid of its parents - pid_t getppid (void);
how is a process created?
only by another process
how can we differentiate between a parent and child process?
fork() returns:
- 0 to the child
- pid of child to parent
- -1 if error occurs
what does fork() do?
creates a child that is the exact copy of parent process, and hence executes the same program
what does exec() do?
allows a process to switch execution to a d/t program
when does a process stop?
how can a process stop another process?
what does a signal do?
notifies a process that a particular event has occurred
list some examples of signals.
SIG:
- SEGV - seg fault
- BUS - bus error
- PIPE - trying to write to a disconnected pipe
- CHLD - child process has stopped
- USR1, USR2 - generic signal used by user programs
why can’t processes influence eachother?
they are executed in isolation from each other
why can’t processes influence eachother?
they are executed in isolation from each other
in what ways can interprocess communications take place?
Through:
- semaphores
- pipes
- shared memory
- signaling
what is a pipe?
what type of processes can a pipe link?
those that share a parent since they’d inherit a file descriptor
what is shared memory?
how to use shared memory?
how do we create a shared memory seg?
int shmget (Key_t key, int size, int shmflg);