Intro to Processes
Objectives
We would like to :
- Review the basics of a process.
Notes
- Running user programs is probably the most important task of the os.
- A program is code on a disk, a process is created when this code is running on a computer.
- Or in one of several other states.
- Sometimes a process is called a job, from earlier versions of an os.
- We know processes have
- PC, IR, Memory Segments.
- Activation Record(s)
- Processes (interpreters) can run processes (sort of)
- Look at the figure on page 108.
- The state of a process
- Classically processes can exist in a number of different states.
- New: it is being created
- Running: currently is being executed
- Ready: Has all resources and is ready to be executed
- Currently in the run time queue
- Waiting: blocked for some resource
- Terminated: finished execution.
- Linux:
- Idle is blocked and waiting.
- Sleeping: suspended for some reason
- Zombie: terminated, wait for parent to ack.
- Look at process status
- about /proc.
- "The proc file system acts as an interface to internal data structures in the kernel. It can be used to obtain information about the system and to change certain kernel parameters at runtime (sysctl)."
- cat /proc/self/status
- grep State /proc/*/status
- Look at the figure on 109.
- The process control block
- Also the taskk block, or task_struct in linux.
- Holds process information.
- See (/usr/src/kernels/6.12.11-100.fc40.x86_64/include/linux/sched.h)
- Search for task_struct
- A thread is a lightweight process
- But that is for chapter 4.