Lecture 6 Introduction to Process Management

Slides:



Advertisements
Similar presentations
3.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Process An operating system executes a variety of programs: Batch system.
Advertisements

Operating Systems Manage system resources –CPU scheduling –Process management –Memory management –Input/Output device management –Storage device management.
Slide 2-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 2 Using the Operating System 2.
Operating Systems COMP 4850/CISG 5550 Processes Introduction to Threads Dr. James Money.
Chap 2 System Structures.
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.
Chapter 6 Review System Software: Operating Systems and Utilities.
Lesson 10-Controlling User Processes. Overview Managing and processing processes. Managing jobs. Exiting/quitting when jobs have been stopped.
Thursday, June 08, 2006 The number of UNIX installations has grown to 10, with more expected. The UNIX Programmer's Manual, 2nd Edition, June, 1972.
INTRODUCTION OS/2 was initially designed to extend the capabilities of DOS by IBM and Microsoft Corporations. To create a single industry-standard operating.
1 CS 333 Introduction to Operating Systems Class 2 – OS-Related Hardware & Software The Process Concept Jonathan Walpole Computer Science Portland State.
Review: Operating System Manages all system resources ALU Memory I/O Files Objectives: Security Efficiency Convenience.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
Process in Unix, Linux and Windows CS-3013 C-term Processes in Unix, Linux, and Windows CS-3013 Operating Systems (Slides include materials from.
CS-502 Fall 2006Processes in Unix, Linux, & Windows 1 Processes in Unix, Linux, and Windows CS502 Operating Systems.
Unix & Windows Processes 1 CS502 Spring 2006 Unix/Windows Processes.
Processes in Unix, Linux, and Windows CS-502 Fall Processes in Unix, Linux, and Windows CS502 Operating Systems (Slides include materials from Operating.
5 UNIX Processes. Introduction  Processes  How to list them  How to terminate them  Process priorities  Scheduling jobs  Signals.
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.
Week 6 Operating Systems.
Linux in More Detail Shirley Moore CPS5401 August 29,
CSC 322 Operating Systems Concepts Lecture - 4: by Ahmed Mumtaz Mustehsan Special Thanks To: Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Linux+ Guide to Linux Certification, Third Edition
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 6 System Calls OS System.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Processes CSCI 4534 Chapter 4. Introduction Early computer systems allowed one program to be executed at a time –The program had complete control of the.
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.
CS 390 Unix Programming Environment
Processes and Threads MICROSOFT.  Process  Process Model  Process Creation  Process Termination  Process States  Implementation of Processes  Thread.
Operating Systems Unit 2: – Process Context switch Interrupt Interprocess communication – Thread Thread models Operating Systems.
CSC414 “Introduction to UNIX/ Linux” Lecture 3
Agenda Managing Processes (Jobs) Command Grouping Running jobs in background (bg) Bringing jobs to foreground (fg), Background job status (jobs) Suspending.
Agenda The Bourne Shell – Part I Redirection ( >, >>,
OPERATING SYSTEM BASICS. What is an operating system and what does it do? The operating system has two basic functions: –communicates with the PC.
Threads, SMP, and Microkernels Chapter 4. Processes and Threads Operating systems use processes for two purposes - Resource allocation and resource ownership.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
Processes and Threads Chapter 3 and 4 Operating Systems: Internals and Design Principles, 6/E William Stallings Patricia Roy Manatee Community College,
Operating System & Application Software
Resource Management IB Computer Science.
Process Management Process Concept Why only the global variables?
Chapter 3: Process Concept
Chapter 2 Processes and Threads Today 2.1 Processes 2.2 Threads
Chapter 3 – Process Concepts
Process Management Presented By Aditya Gupta Assistant Professor
Chapter 3: Processes Source & Copyright: Operating System Concepts, Silberschatz, Galvin and Gagne.
Introduction to Operating System (OS)
Chapter 3: Processes.
Processes in Unix, Linux, and Windows
Lecture 2: Processes Part 1
Chapter 2: System Structures
Processes in Unix, Linux, and Windows
CHAPTER 8 ( , ) John Carelli, Instructor Kutztown University
Operating Systems Lecture 12.
Mid Term review CSC345.
Chapter 3: Processes.
CSC 140: Introduction to IT
Threads and Concurrency
Operating Systems Processes (Ch 4.1).
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Chapter 3: Processes.
Processes in Unix, Linux, and Windows
Processes in Unix and Windows
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Processes – Part I.
CS510 Operating System Foundations
Lab 6: Process Management
Introduction to Operating Systems
Chapter 3 Processes.
Presentation transcript:

Lecture 6 Introduction to Process Management COP 3353 Introduction to UNIX 1

Multi-xxxx The UNIX Operating System provides an environment in which multiple “processes” can run concurrently Multitasking or multiprogramming: the ability to run multiple programs on the same machine concurrently Multiprocessing: the ability to use multiple processors on the same machine Multiprocessing sometimes is also used to indicate that multiple concurrent processes can execute at the same time in a single processor environment UNIX supports both multiprogramming and multiprocessing (in both senses)‏ This is implemented through the process abstraction More recently supporting Light Weight Processes and Threads has also become the norm 2

The Process Abstraction In traditional systems a process executes a single sequence of instructions in an address space. The program counter (PC) is a special hardware register that tracks the current instruction that is to be execute In UNIX, many processes are active at the same time and the OS provides some aspects of a virtual machine Processes have their own registers and memory, but rely on the OS for I/O, device control and interacting with other processes Processes: Run in a virtual address space Content for resources such as processor(s), memory, and peripheral devices All of the above is managed by the OS the memory management system; the I/O system; the process management and scheduling system, and the Interprocess Communication system (IPC)‏ 3

More about a Process Processes are created by the OS, typically by the fork command. The process that calls fork is the parent and the new process is the child. The child inherits a replica of the parent’s address space and is essentially a clone. Both continue to execute the identical program. Fork returns the child’s process id to the parent, and the value 0 to the child. The exec system call loads another program and starts running this (typically in the child process). States of a Process Initial, ready to run, running (in user mode or kernel mode), asleep, stopped, zombie (upon exit), orphaned (no parent). Finally, when all resources are freed by the parent, the process is terminated or no longer exists. 4

Basic job control commands ps: displays information about processes Some common options:[-e] or [-A]: all processes [-l] longer version [u] current user report [-aux] more complete listing &: running a process (job) in the background example: pp3 & jobs: shows you all your background processes fg: puts a background job into the foreground CTRL-z: stops a process bg: puts a job into the background CTRL-c: kill the foreground job kill: kill a specific job (-9 typically kills most processes)‏ 5

More job control commands sleep: causes the current process to sleep for the time indicated. example: sleep 15; ls sleep 10; ls & stop: can be used to stop a specific job running in the background nice: run a job with a lower (nicer) priority level ranges are -20 (highest) to +20 (lowest). Default is 0. Default nice is usually 4. example: nice +10 pp3 6

Running more than one shell By using the csh command, you can start another shell running. You can change directories etc in this shell, and go back to your original shell by using the suspend command. Example csh (get a new shell, do some work, say change directory)‏ suspend (go back to your original shell)‏ (work in your original shell)‏ jobs (get the job number of the csh shell, say 1)‏ fg 1 (bring the csh shell into the foreground)‏ exit (terminate the csh shell and go back to original)‏ 7

Editing and Running Typical way of developing a program Edit a program, say with vi, then save and exit Run the program; determine errors Edit the program by starting another vi session, Etc. Alternate Paradigm Edit a program, say with vi, the write the file (w) and use CTRL-z to stop the vi process Run you program; determine errors Bring back vi by using fg 1 8

X Windows Standard Toolkit and protocol to build GUI Allows for drawing and moving of windows Allow mouse interaction and keyboard Designed to be used over the network Based on a client server model X Server communicates with various client programs Accepts graphical output and sends back user input. Can be used over a secure network through Tunneling.

Starting X Windows Linux environments have native X support. ssh -Y diablo.cs.fsu.edu: Enables trusted X11 forwarding. Microsoft Windows need a helper X program. Xwin32: http://www.starnet.com/ None free – has a trial version Cygwin: http://www.cygwin.com/ Free open source Unix windows port. SSH Client Enable Tunneling (Windows)‏ Xterm – X Terminal is a think client that runs on X server