High Performance Computing Lecture 11. Matthew Jacob Indian Institute of Science

Similar documents
CPSC 457 OPERATING SYSTEMS MIDTERM EXAM

Linux System Administration

Most of the work is done in the context of the process rather than handled separately by the kernel

High Performance Computing Lecture 21. Matthew Jacob Indian Institute of Science

CPSC 457 OPERATING SYSTEMS MIDTERM EXAM SOLUTION

ENGR 3950U / CSCI 3020U Midterm Exam SOLUTIONS, Fall 2012 SOLUTIONS

OS lpr. www. nfsd gcc emacs ls 1/27/09. Process Management. CS 537 Lecture 3: Processes. Example OS in operation. Why Processes? Simplicity + Speed

High Performance Computing Lecture 26. Matthew Jacob Indian Institute of Science

Introduction to OS Processes in Unix, Linux, and Windows MOS 2.1 Mahmoud El-Gayyar

www nfsd emacs lpr Process Management CS 537 Lecture 4: Processes Example OS in operation Why Processes? Simplicity + Speed

CS 475. Process = Address space + one thread of control Concurrent program = multiple threads of control

PROCESSES. Jo, Heeseung

Processes. Jo, Heeseung

Processes & Threads. Recap of the Last Class. Microkernel System Architecture. Layered Structure

Processes and Threads

Chap 4, 5: Process. Dongkun Shin, SKKU

CS 450 Operating System Week 4 Lecture Notes

Operating System Design

Unix Processes. What is a Process?

CS399 New Beginnings. Jonathan Walpole

Agenda Process Concept Process Scheduling Operations on Processes Interprocess Communication 3.2

4.8 Summary. Practice Exercises

CS 333 Introduction to Operating Systems Class 2 OS-Related Hardware & Software The Process Concept

OS lpr. www. nfsd gcc emacs ls 9/18/11. Process Management. CS 537 Lecture 4: Processes. The Process. Why Processes? Simplicity + Speed

Systems Programming/ C and UNIX

Outline. Threads. Single and Multithreaded Processes. Benefits of Threads. Eike Ritter 1. Modified: October 16, 2012

Chapter 4: Threads. Overview Multithreading Models Threading Issues Pthreads Windows XP Threads Linux Threads Java Threads. Operating System Concepts

Simplest version of DayOfYear

Processes and Threads

CSE 153 Design of Operating Systems Fall 2018

Unix API Books. Linux Kernel Books. Assignments and Exams. Grading for CSC 256. Operating Systems 8/31/2018. CSC 256/456 Fall

Lecture 1 OS Introduction. Bo 2018, Spring

Processes. CS 416: Operating Systems Design, Spring 2011 Department of Computer Science Rutgers University

Getting to know you. Anatomy of a Process. Processes. Of Programs and Processes

Processes. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

CS 333 Introduction to Operating Systems. Class 2 OS-Related Hardware & Software The Process Concept

csci3411: Operating Systems

Process Management! Goals of this Lecture!

Process. Heechul Yun. Disclaimer: some slides are adopted from the book authors slides with permission 1

CPSC 341 OS & Networks. Processes. Dr. Yingwu Zhu

Operating System Labs. Yuanbin Wu

S E C T I O N O V E R V I E W

Storage Management 1

Processes in linux. What s s a process? process? A dynamically executing instance of a program. David Morgan. David Morgan

CS 537 Lecture 2 - Processes

Princeton University. Computer Science 217: Introduction to Programming Systems. The Memory/Storage Hierarchy and Virtual Memory

CMPS 105 Systems Programming. Prof. Darrell Long E2.371

Version of 22 OCBC Bank. All Rights Reserved

CS 550 Operating Systems Spring Process II

Processes. Sanzheng Qiao. December, Department of Computing and Software

Chapter 5: Threads. Overview Multithreading Models Threading Issues Pthreads Windows XP Threads Linux Threads Java Threads

Chapter 4: Threads. Chapter 4: Threads

Chapter 4: Threads. Operating System Concepts. Silberschatz, Galvin and Gagne

Operating Systems Concepts

Introduction to Operating Systems Prof. Chester Rebeiro Department of Computer Science and Engineering Indian Institute of Technology, Madras

I.-C. Lin, Assistant Professor. Textbook: Operating System Concepts 8ed CHAPTER 4: MULTITHREADED PROGRAMMING

Processes. CS439: Principles of Computer Systems January 24, 2018

CSE 4/521 Introduction to Operating Systems

Chapter 3: Processes. Operating System Concepts 9 th Edit9on

Chapter 4: Threads. Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Linux Threads

CSE 410: Computer Systems Spring Processes. John Zahorjan Allen Center 534

Processes & Threads. Recap of the Last Class. Layered Structure. Virtual Machines. CS 256/456 Dept. of Computer Science, University of Rochester

CS307 Operating Systems Introduction Fan Wu

CS307: Operating Systems

COS 318: Operating Systems

Operating Systems and Protection CS 217

CSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song

Processes. CS3026 Operating Systems Lecture 05

Process Management 1

CSCE 313: Intro to Computer Systems

Processes. CS439: Principles of Computer Systems January 30, 2019

Distributed Systems Operation System Support

PROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo

Threads. Thread Concept Multithreading Models User & Kernel Threads Pthreads Threads in Solaris, Linux, Windows. 2/13/11 CSE325 - Threads 1

Fall 2017 :: CSE 306. Process Abstraction. Nima Honarmand

Chapter 4: Threads. Operating System Concepts with Java 8 th Edition

Operating Systems CMPSC 473. Process Management January 29, Lecture 4 Instructor: Trent Jaeger

Binghamton University. CS-220 Spring Sharing Resources. Computer Systems Chapter 8.2, 8.4

Process. Heechul Yun. Disclaimer: some slides are adopted from the book authors slides with permission

Lecture 2: Processes. CSE 120: Principles of Opera9ng Systems. UC San Diego: Summer Session I, 2009 Frank Uyeda

Chapter 3: Process Concept

Chapter 3: Process Concept

Sperimentazioni I LINUX commands tutorial - Part II

SE350: Operating Systems

System Programming. Introduction to Unix

CSE 153 Design of Operating Systems

Operating Systems. Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000) alphapeeler.sf.net/pubkeys/pkey.htm

CSCB09: Software Tools and Systems Programming. Bianca Schroeder IC 460

Problem Set: Processes

THREADS. Jo, Heeseung

PROCESS PROGRAMMING INTERFACE

Chapter 3: Process Concept

CMPSCI 230 Computer Systems Principles. Processes

Lecture 2 Fundamental OS Concepts. Bo 2018, Spring

OPERATING SYSTEM. Chapter 4: Threads

Physical memory vs. Logical memory Process address space Addresses assignment to processes Operating system tasks Hardware support CONCEPTS 3.

Threads. What is a thread? Motivation. Single and Multithreaded Processes. Benefits

The Big Picture So Far. Today: Process Management

What is a Process. Processes. Programs and Processes. System Classification 3/5/2013. Process: An execution stream and its associated state

Processes. What s s a process? process? A dynamically executing instance of a program. David Morgan

Transcription:

High Performance Computing Lecture 11 Matthew Jacob Indian Institute of Science

Agenda 1. Program execution: Compilation, Object files, Function call and return, Address space, Data & its representation (4) 2. Computer organization: Memory, Registers, Instruction set architecture, Instruction processing (6) 3. Virtual memory: Address translation, Paging (4) 4. Operating system: Processes, System calls, Process management (6) 5. Pipelined processors: Structural, data and control hazards, impact on programming (4) 6. Cache memory: Organization, impact on programming (5) 7. Program profiling (2) 8. File systems: Disk management, Name management, Protection (4) 9. Parallel programming: Inter-process communication, Synchronization, Mutual exclusion, Parallel architecture, Programming with message passing using MPI (5) 2

Computer Organization: Hardware CPU ALU Registers MMU Control Cache Memory Bus I/O I/O I/O 3

Computer Organization: Software Hardware resources of computer system are shared by programs in execution Operating System: Special software that manages this sharing 4

Operating Systems (OS) Examples Unix AIX, HP-UX, Solaris Linux Fedora, opensuse, Ubuntu, Debian Apple Mac OS Mac OS X Snow Leopard Microsoft Windows Windows 7, Vista, XP Google Chrome OS 5

Computer Organization: Software Hardware resources of computer system are shared by programs in execution Operating System: Special software that manages this sharing Process: A program in execution i.e., present in main memory and being executed On Unix systems, you can use ps to get information about the current status of processes % ps Shell prompt 6

Computer Organization: Software Hardware resources of computer system are shared by programs in execution Operating System: Special software that manages this sharing Process: A program in execution Shell: A command interpreter, through which you interact with the computer system Examples of Unix shells: csh, bash A program; just another program 7

% ps PID TTY TIME CMD 15459 pts/10 00:00:00 bash 15491 pts/10 00:00:00 ps 8

% ps -a PID TTY TIME CMD 6358 pts/4 00:00:00 pine 15538 pts/10 00:00:00 ps 20252 pts/2 00:00:01 pine 31066 pts/5 00:00:01 emacs-x 31072 pts/5 00:00:00 xterm 31084 pts/5 00:00:00 xdvi-xaw3d.bin % ps -l F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 0 S 539 15459 15458 0 76 0-16517 wait pts/10 00:00:00 bash 0 R 539 15539 15459 0 78 0-15876 - pts/10 00:00:00 ps 9

Operating System, Processes, Hardware CPU ALU Registers MMU Control Cache Memory Bus I/O I/O I/O 10

Operating System, Processes, Hardware 11

Operating System, Processes, Hardware Processes Operating System System Calls Hardware 12

Operating System, Processes, Hardware Processes OS Kernel System Calls Hardware 13

System Calls How a process gets the operating system to do something for it Interface or API (Application Programming Interface) for interaction with the operating system 14

System Calls How a process gets the operating system to do something for it Interface or API (Application Programming Interface) for interaction with the operating system Examples: Operations on files creat(): to create a new file unlink(): to remove a file open(): to open a file for reading and/or writing read(): to read data from an open file into a variable write(): to write data into an open file lseek(): to change the current pointer into the open file 15

System Calls How a process gets the operating system to do something for it Interface or API (Application Programming Interface) for interaction with the operating system Examples: Operations on processes fork(): to create a new process Terminology: parent process calls fork() which causes a child process to be created Both parent and child processes continue to execute from that point in the program 16

System Calls How a process gets the operating system to do something for it Interface or API (Application Programming Interface) for interaction with the operating system Examples: Operations on processes fork(): to create a new process exec(): to change the memory image of a process e,g, to change the program that a process is executing 17

fork( ) and exec( ) Parent Process text data heap Child Process text data heap retval = fork(); if (retval == 0) { /* child */ exec( ); } else { /* parent */ } stack stack 18

fork( ) and exec( ) Parent Process text Child Process text data data heap stack stack 19

System Calls How a process gets the operating system to do something for it Interface or API (Application Programming Interface) for interaction with the operating system Examples: Operations on processes fork(): to create a new process exec(): to change the memory image of a process exit(): to terminate wait(): to make parent sleep until child terminates 20

System Calls How a process gets the operating system to do something for it Interface or API (Application Programming Interface) for interaction with the operating system Examples: Operations on memory sbrk: can be used by malloc() to increase size of the heap 21

System Calls How a process gets the operating system to do something for it Interface or API (Application Programming Interface) for interaction with the operating system Examples: Operations on files, processes, memory, etc When a process is executing in a system call, it is actually executing Operating System code 22

Operating System, Processes, Hardware Processes Operating System System Calls Hardware 23