- An operating system executes a variety of programs:F Batch system – jobsF Time- shared systems – user programs or tasks
- Textbook uses the terms job and process almost interchangeably.
- Process – a program in execution; process execution must progress in sequential fashion.
A process includes:
-program counter
- stack
-data section
Process State
- As a process executes, it changes state
1. new: The process is being created.
2. running: Instructions are being executed.
3. waiting: The process is waiting for some event to occur.
4. ready: The process is waiting to be assigned to a process.
5. terminated: The process has finished execution
Process State Diagram
Process Control Block
- Information associated with each process.
- Process ID
- Process state
- Program counter
- CPU registers
- CPU scheduling information
- Memory-management information
- Accounting information
- I/O status information
Process Control Block
Threads
- One view of a thread is as an independent program counteroperating within a process
- A thread is sometimes called a lightweight process (LWP), butis a smaller execution that a process
- A thread consists of:
-a thread execution state (Running, Ready, etc.)
-a context (program counter, register set)
-an execution stack-some per-thread static storage for local variables
-access to the memory and resources of its process (shared withall other threads in that process)
-OS resources (open file, signals, etc.)
0 comments:
Post a Comment