Process states in Windows 2000 and Linux Module

  • Slides: 9
Download presentation
Process states in. Windows 2000 and Linux Module 2. 1

Process states in. Windows 2000 and Linux Module 2. 1

Windows 2000 Process Object

Windows 2000 Process Object

Windows 2000 Thread Object

Windows 2000 Thread Object

Windows 2000 Thread States • • • Ready Standby Running Waiting Transition Terminated

Windows 2000 Thread States • • • Ready Standby Running Waiting Transition Terminated

Linux Process & Threads • Most multithreaded OSs define a thread separately from processes.

Linux Process & Threads • Most multithreaded OSs define a thread separately from processes. Linus Torvalds has defined that a thread is “context of execution” (COE). • This means that only one process/thread table and one scheduler is needed. So switching thread or process is the same in Linux. • Creation of thread is done using “clone” system call. Creation of a process is done using “fork” system call. Clone has options to share: all VM, filesystem, I/O, signal handlers. • clone() is an extension to fork(). In fact, clone(SIGCHLD, 0) == fork(). • There are “Kernel threads” running only in kernel mode and only runs system programs and execute a single specific kernel function, e. g. , kflushd, kupdate, kpiod, kswapd. • Linux Threads FAQ – http: //www. linuxdoc. org/FAQ/Threads-FAQ/index. html

Linux States of a Process • Running and Ready: The process is either running

Linux States of a Process • Running and Ready: The process is either running (it is the current process in the system) or it is ready to run (it is waiting to be assigned to one of the system’s CPUs). • Interruptable: Means the task is sleeping (waiting for an I/o or synchronization event) but can be woken up by a signal. • To list all signals, use “kill –l” SIGHUP SIGINT SIGKILL SIGTRAP SIGIOT SIGBUS SIGFPE SIGKILL SIGUSR 1 SIGSEGV SIGUSR 2 SIGPIPE SIGALRM SIGTERM SIGCHLD SIGCONT SIGSTOP SIGSTP SIGTTIN SITTOUT SIGURG SIGXCPU SIGXFSZ SIGVTALRM SIGPROF SIGWINCH SIGIO SIGPWR • Uninterruptable: Same as TASK_INTERRUPTABLE, except it cannot be woken up by signals or timer • Stopped: Task was stopped, usually by a SIGSTOP signal such as when performing debugging • Zombie: Task has terminated but has not had its status collected (wait() -ed for) by the parent.