Part 1:processes
Process:an abstraction of running program.
A CPU can really only run one process at a time, if there is both cores each one of the them can run only one process at a Tim E.
Process Creation
Operating systems need some to create processes. There is four events this cause processes to be created:
- System initialization
- Execution of a process creation system call by a running process
- A user request to create a new process
- Initiation of a batch job
daemons: processes that stay in the background to handle some activity such as e-mail, Web pages, news, printing, And so on.
Note:in UNIX, the PS program can is used to list the running processes. In Windows, Task Manager.
Note:in UNIX, only one system call to create a new process: fork. In Windows, CreateProcess
Process termination, usually due to one of the following conditions:
- Normal exit (voluntary)
- Error exit (voluntary)
- Fatal Error (involuntary)
- Killed by another process (involuntary)
Note: exit () in UNIX and exitprocess () in Windows
Process states
- Running (actually using the CPU at that instant)
- Ready (runnable; temporaily stopped-let another process run)
- Blocked (unable to run until some external event happens)
Part 2:threads
Processes and Threads