1.Concept on Process
An operating system executes a variety of programs:


  • Batch system – jobs
  • Time-shared systems – user programs or task

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









  • new: The process is being created.
  • running: Instructions are being executed.

  • waiting: The process is waiting for some event to occur

  • ready: The process is waiting to be assigned to a processor

  • terminated: The process has finished execution.


Process Control Block


Information associated with each process.


Process ID

Process staten Program counter

CPU registersn CPU scheduling information


Memory-management information


Accounting information

I/O status information





Threads


In computer science, a thread of execution results from a fork of a computer program into two or more concurrently running tasks. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process. Multiple threads can exist within the same process and share resources such as memory, while different processes do not share these resources.
On a single processor, multithreading generally occurs by time-division multiplexing (as in multitasking): the processor switches between different threads. This context switching generally happens frequently enough that the user perceives the threads or tasks as running at the same time. On a multiprocessor or multi-core system, the threads or tasks will generally run at the same time, with each processor or core running a particular thread or task. Support for threads in programming languages varies: a number of languages simply do not support having more than one execution context inside the same program executing at the same time.