CHAPTER 13 Processes.

Slides:



Advertisements
Similar presentations
June 1, 1999Foreground/Background Processing1 Introduction to UNIX H. Foreground/Background Processing.
Advertisements

Using tcpdump. tcpdump is a powerful tool that allows us to sniff network packets and make some statistical analysis out of those dumps. tcpdump operates.
Second edition Your UNIX: The Ultimate Guide Das © 2006 The McGraw-Hill Companies, Inc. All rights reserved. UNIX – The Process The Process A process is.
Processes and Job Control. Foreground and Background (1)  Unix is a multi-tasking operating system –some of these tasks are being done by other users.
Process groups, sessions, controlling terminal, and job control Process relationship: –Parent/child –Same group –Same session.
Job Control Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See
Chapter 13 Processes. Copyright © 2005 Pearson Addison-Wesley. All rights reserved. Objectives To describe the concept of a process, and execution of.
Process Relationships Terminal and Network Logins Process Groups and Sessions Job Control Relationships.
Lesson 10-Controlling User Processes. Overview Managing and processing processes. Managing jobs. Exiting/quitting when jobs have been stopped.
1 Introduction to UNIX Ke Liu
Chapter 13 Processes. What is a process? A process is a program in execution A process is created whenever an external command is executed Whenever the.
Shells and Processes Bryce Boe 2012/08/08 CS32, Summer 2012 B.
Operating Systems Yasir Kiani. 20-Sep Agenda for Today Review of previous lecture Use of FIFOs in a program Example code Process management commands.
Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
CS 497C – Introduction to UNIX Lecture 26: - The Process Chin-Chih Chang
Linux+ Guide to Linux Certification, Second Edition
More Shell Basics CS465 - Unix. Unix shells User’s default shell - specified in /etc/passwd file To show which shell you are currently using: $ echo $SHELL.
Processes & Daemons Chapter IV / Part III. Commands Internal commands: alias, cd, echo, pwd, time External commands, code is in a file: grep, ls, more.
Process Description and Control A process is sometimes called a task, it is a program in execution.
Phones OFF Please Processes Parminder Singh Kang Home:
Introduction to Embedded Systems Traditional OS Processes and Scheduling Lecture 15hb.
5 UNIX Processes. Introduction  Processes  How to list them  How to terminate them  Process priorities  Scheduling jobs  Signals.
1 The Shell and some useful administrative Unix Commands How Unix works along with some additional, useful administrative Unix commands you might need.
UNIX Processes. The UNIX Process A process is an instance of a program in execution. Created by another parent process as its child. One process can be.
Managing Processes CSCI N321 – System and Network Administration Copyright © 2000, 2011 by Scott Orr and the Trustees of Indiana University.
Chapter 4 UNIX Common Shells Commands By C. Shing ITEC Dept Radford University.
Linux+ Guide to Linux Certification, Third Edition
Process Control. Module 11 Process Control ♦ Introduction ► A process is a running occurrence of a program, including all variables and other conditions.
Managing processes and services. 1. How Linux handles processes 2. Managing running processes 3. Scheduling processes.
Linux+ Guide to Linux Certification, Second Edition Chapter 10 Managing Linux Processes.
SILICON VALLEY UNIVERSITY CONFIDENTIAL 1 Introduction to UNIX / Linux - 8 Dr. Jerry Shiao, Silicon Valley University.
The kernel considers each program running on your system to be a process A process lives as it executes, with a lifetime that may be short or long A process.
Hands On UNIX II Dorcas Muthoni. Processes A running instance of a program is called a "process" Identified by a numeric process id (pid)‏  unique while.
Agenda  Working with Processes: Purpose Running Programs within same process (execl, execlp, execle, execv, execvp, execve) “Spawning” other process (fork,
Silberschatz, Galvin and Gagne  Operating System Concepts Process Concept An operating system executes a variety of programs:  Batch system.
Linux+ Guide to Linux Certification Chapter Eleven Managing Linux Processes.
Processes Dr. Yingwu Zhu. Process Concept Process – a program in execution – What is not a process? -- program on a disk - a process is an active object,
1 Lecture 6 Introduction to Process Management COP 3353 Introduction to UNIX.
Getting Started UNIX InKwan Yu Topics Unix Commands Unix System calls C function calls.
CIT 140: Introduction to ITSlide #1 CSC 140: Introduction to IT Processes.
1  process  process creation/termination  context  process control block (PCB)  context switch  5-state process model  process scheduling short/medium/long.
Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 5.1 © Copyright IBM Corporation 2008 Unit 9 Working.
Module 1 - Introduction to Linux. Users must log-in Linux is case sensitive File and Directories naming conventions (No spaces!) Files and Directories.
Agenda Managing Processes (Jobs) Command Grouping Running jobs in background (bg) Bringing jobs to foreground (fg), Background job status (jobs) Suspending.
Unix System Administration Controlling Processes Chapter 5.
Agenda The Bourne Shell – Part I Redirection ( >, >>,
An Introduction to processes R Bigelow. A Unix Process A process in Unix is simple a program The Unix system is made up of a group of processes all interacting.
Process Relationships Chien-Chung Shen CIS/UD
...looking a bit closer under the hood
Chapter 13 Processes.
...looking a bit closer under the hood
Linux Commands Help HANDS ON TRAINING Author: Muhammad Laique
The UNIX Shell Learning Objectives:
Chapter 11 – Processes and Services
Hands On UNIX AfNOG 2010 Kigali, Rwanda
Processes A process is a running program.
Hands On UNIX AfNOG X Cairo, Egypt
Operating Systems Lecture 11.
Process Models, Creation and Termination
The Linux Command Line Chapter 10
...looking a bit closer under the hood
Operating Systems Lecture 5.
CHAPTER 8 ( , ) John Carelli, Instructor Kutztown University
Operating Systems Lecture 12.
CSC 140: Introduction to IT
Lecture 6: Multiprogramming and Context Switching
Chapter 3: Processes.
Processes – Part I.
Lab 6: Process Management
Lecture 6 Introduction to Process Management
Presentation transcript:

CHAPTER 13 Processes

A process is a program in execution . A process is created every time you run an external command . A process is removed from the system when command finishes its execution. -A process is executed for a short period of time, and then the CPU is taken away from it and given to another process. -The Time a process is in the CPU burst before it is switched out of the CPU is called quantum or time slice . -The Kernel uses an algorithm to decide which process gets to use the CPU next. the technique used to choose the process that gets to use the CPU is called CPU scheduling . METHODS ( FCFS,ROUND ROBIN etc……)

NORMAL: A process terminates normally when it finishes its work UNIX Process Status : NORMAL: A process terminates normally when it finishes its work and exits the system gracefully . ABNORMAL: A process terminates abnormally when it exits the system because of an exception, condition or intervention by its owner. PROCESS STATES: - Ready: A process is ready to run but does not have the CPU. - Running: The process is actually running. - Waiting: The process is waiting for an event. - Swapped: The process is ready to run but it has been temporarily put a side because it needs more memory. - Zombie: A Dying process.

Parent and Child process: Internal commands: An internal command is one whose code is part of the shell process. External commands: An external command is one whose code is in a file. Fork System Parent and Child process: -The very first process that executes is the parent process - The process that execute under the parent process is a child process ,Child process can be many .

Process id + name for every command during execution To view a process $ ps PID TTY TIME CMD tty2 00:00:01 bash $ csh % ksh % ps PID TTY TIME CMD tty2 00:00:01 bash tty2 00:00:02 csh tty2 00:00:01 ksh ^D ^D

Out put with out session leader To view a process # ps PID TTY TIME CMD tty1 00:00:00 tree tty2 00:00:01 bash tty1 00:00:09 vi # ps –a PID TTY TIME CMD tty1 00:00:00 tree tty1 00:00:09 vi

Processes of a user To view a process # ps –u 147 OR # ps –u Usman UID PID TTY TIME CMD 789 tty1 00:00:00 tree 147 869 tty2 00:00:01 bash 147 658 tty1 00:00:09 vi OR # ps –u Usman UID PID TTY TIME CMD 789 tty1 00:00:00 tree 147 869 tty2 00:00:01 bash 147 658 tty1 00:00:09 vi

Process id + name for every command during execution To view a process # ps PID TTY TIME CMD tty1 00:00:00 tree tty2 00:00:01 bash tty1 00:00:09 vi # ps –l

Some more important commands of the chapter # top (displays the on going programs on the system , refreshed the screen after every 5sec.) To exit from top press CTRL C

Foreground and Background Process Foreground Process: When a command executes in the foreground , it keeps control of the keyboard and the display screen. find / -name docUnix -print > /home/umar/Umar.txt Background Process: While the command executes you gets the shall prompt back and can do other work. find / -name docUnix -print > /home/umar/Umar.txt & [1] 68743 Job id process id

Foreground and Background Process find / -name docUnix -print > /home/umar/Umar.txt & [1] 834 find / -name Doc545 -print > /home/ali/ali.txt & [2] 3354 find / -name Mydoc -print > /home/usman/Usman.txt & [3] 5837 # ps PID TTY TIME CMD 834 pts/0 0:03 find / -name docUnix -print > /home/umar/Umar.txt & 3354 pts/0 0:11 find / -name Doc545 -print > /home/ali/ali.txt & 5837 pts/0 0:04 find / -name Mydoc -print > /home/usman/Usman.txt &

Changing the Foreground and Background Process find / -name docUnix -print > /home/umar/Umar.txt # fg # fg %3 find / -name Mydoc -print > /home/usman/Usman.txt # bg find / -name docUnix -print > /home/umar/Umar.txt & [1] 83423 # bg %2 find / -name Doc545 -print > /home/ali/ali.txt & [2] 647 # jobs

Sequential and parallel execution of commands date; echo Hello, world! Fri Jun 18 23:42:28 PDT 2014 Hello, world! date& echo hello, world& uname ; who [1] 4543 [2] 5538 Hello, world! [2] Done Fri Jun 18 23:43:48 PDT 2014 [1] Done Unix0s Rashid pts/0 jun 12 13:33 Abbas pts/1 jun 18 02:55

Sequential and parallel execution of commands (date; echo Hello, world!) who Fri Jun 18 23:42:28 PDT 2014 Hello, world! Rashid pts/0 jun 12 13:33 Abbas pts/1 jun 18 02:55 (date, echo hello, world)& [1] 4543 Fri Jun 18 23:43:48 PDT 2014 Hello, world! [1] Done

Sequential and parallel execution of commands (date; echo Hello, world) & (who; uname)& whoami [1] 6533 [2] 1464 Haider Fri Jun 18 23:42:28 PDT 2014 Hello, world [1] Done Rashid pts/0 jun 12 13:33 Abbas pts/1 jun 18 02:55 Unixos [2] Done

Process id + name for every command during execution To view a process by its id number # ps 738 PID TTY TIME CMD tty1 00:00:00 tree To Terminate a process # kill 738 [1]+ Terminated tree To Terminate a process forcefully # kill -9 738 [1]+ Terminated tree PID The terminating options start from 1 - 9 .

Init process : The very first process, a process which has no parent Init process : The very first process, a process which has no parent. Process id is 1. Getty process Login process User and password Session ptree -a hamza /etc/init /usr/sbin/inetd –s -bash sh 8975 ptree –a hamza disPlayed With option -a