CS 5523: Operating Systems
|
|
- Lora Patrick
- 6 years ago
- Views:
Transcription
1 CS 5523: Operating Systems Instructor: Dr. Tongping Liu Midterm Exam: Oct 6, 2015, Tuesday 7:15pm 8:30pm CS5523: Operating UTSA 1
2 Lecture1: OS Overview Operating System: what is it?! Evolution of Computer Systems and OS Concepts Different types/variations of Systems/OS Ø Parallel/distributed/real-time/embedded OS etc. OS as a resource manager Ø How does OS provide service? interrupt/system calls OS Structures and basic components Ø Process/memory/IO device managers Basic design approaches Ø Monolithic/layered/microkernel/virtual machine etc. CS5523: Operating UTSA 2
3 Components in Operating System Process/thread Management Ø CPU (processors): most precious resource Memory Management Ø Main memory File Management à data /program Secondary-Storage Management à disk I/O System Management à I/O devices Protection and Security à access management I/O devices 3
4 OS Interface: APIs and System Calls For application programmers Application programming interface (API) Ø The run-time support system (run-time libraries) provides a system-call interface, that intercepts function calls in the API and invokes the necessary system call within the operating system System calls provide the interface between a running program and the operating system. Ø Generally available in routines written in C and C++ Ø Certain low-level tasks may have to be written using assembly language 4
5 Example: System-Call Processing 5
6 . Types of System Calls Process control" File management" Device management" Information maintenance" Communications" Protection" "
7 System call control flow - Linux User applica+on calls a user- level library rou+ne (gettimeofday(), read(), exec(), etc.) Invokes system call through stub, which specifies the system call number. From unistd.h: #define NR_getpid 172 SYSCALL( NR_getpid, sys_getpid) This generally causes an interrupt, trapping to kernel Kernel looks up system call number in syscall table, calls appropriate func+on Func+on executes and returns to interrupt handler, which returns the result to the userspace process 7 4/5/2012
8 Interrupt Mechanisms Save the current process state Interrupt transfers control to the interrupt service routine (ISR) generally through interrupt vector containing the addresses of all the service routines. ISR: Separate segments of code determine what action should be taken for each type of interrupt. Once the interrupt has been serviced by the ISR, the control is returned to the interrupted program. 8
9 Basic Interrupt Processing 1. The interrupt is issued 2. Processor finishes execution of current instruction 3. Processor signals acknowledgement of interrupt 4. Processor pushes PSW(Program Status Word) and PC to control stack 5. Processor loads new PC value through the interrupt vector 6. ISR saves remainder of the process state information 7. ISR executes 8. ISR restores process state information 9. Old PSW and PC values are restored from the control stack 9
10 Lecture2: Process Management Basic concepts of process Ø Process control block (PCB) and address space Basic operations for process management Ø Process creation/termination States of process: different queues Ø ready, running, or wait etc Ø Context switch: multiple hardware running contexts Scheduling of process: CPU scheduling Ø Basic scheduling algorithms: FIFO, SJF etc Inter process communication Ø shared memory and message CS5523: Operating UTSA 10
11 Process vs. Program Program: a set of functions Ø a passive entity Ø stored as files on disk Process: a program in execution Ø Dynamic concept: running of a program How do we run a program? What are steps to create a process? 11
12 Process: Running Context Registers: in addition to general registers Ø Program Counter (PC): contains the memory address of the next instruction to be executed. Ø Stack Pointer (SP): points to the top of the current stack in memory. The stack contains one frame for each procedure that has been entered but not yet exited. Ø Program Status Word (PSW): is an IBM System/360 architecture and successors control register, which performs the function of a Status register and Program counter in other architectures Higher level resources: open files etc. Synchronization and communication resource: semaphores and sockets 12
13 Example: PCB in Linux (task_struct) Process Management Registers Program Counter Stack Pointers Process State Priority Scheduling Parameters (slice) Process ID Parent process Process group Time when process started CPU time used Memory Management Pointer to text (code) segment Pointer to data segment Pointer to stack segment File Management Root directory Working directory User Id Group Id List of open files 13
14 Context Switch When CPU switches to another process, the system must save the state of the old process and load the saved state for the new process via a context switch! Context of a process represented in the PCB" Context-switch time is overhead" Ø 1 ~ 1000 ms" Hardware support" Ø Multiple set of registers" Other performance issues/problems" Ø Cache content: locality is lost" Ø TLB content: may need to flush"
15 Process Creation Address space" Ø Child duplicate its parent (data, program)" Ø Child has a program loaded into it (exec())" Execution" Ø Parent and children execute concurrently" Ø Parent waits until children terminate" Resource sharing: complicated" Ø Shared open files, but not descriptors" Ø Different page tables"
16 An Example: Unix fork( ) pid = 25 Data Text Stack Process Status File File Resources Resources pid = 26 Data Text Stack Process Status < > int cpid = fork( ); if (cpid = = 0) { <child code> exit(0); } <parent code> wait(cpid); cpid = 26 < > int cpid = fork( ); if (cpid = = 0) { <child code> exit(0); } <parent code> wait(cpid); cpid = 0 UNIX kernel 16
17 Create & Terminate Processes What does this print out? void main() { printf("l0\n"); if (fork()!= 0) { printf("l1\n"); if (fork()!= 0) { printf("l2\n"); fork(); } } printf("bye\n"); } L0 L1 L2 Bye Bye Bye Bye 05_fork.c
18 Activities in Processes Bursts of CPU usage alternate with periods of I/O wait CPU-bound: high CPU utilization, interrupts are processed slowly I/O-bound: more time is spending on requesting data than processing it Process 1: CPU bound" Total CPU usage" CPU bursts" I/O waits" Process 2:" I/O bound" Time" Total CPU usage" 18
19 Multiprogramming CPU-I/O Burst Cycle Multiprogramming is a form of parallel processing in which several programs are run at the same time on a uniprocessor. Ø Objective? Maximize CPU utilization. When a process wait for IO, all waiting time is wasted and no useful work is accomplished. 19
20 Classical Scheduling Algorithms FCFS: non-preemptive, based on arrival time Ø Long waiting time, e.g. long process before SSH console? SJF(shortest job first): preemptive & non-preemptive Ø Optimal in term of waiting time RR (Round-robin): preemptive Ø Processes take turns with fixed time quantum e.g., 10ms Priority-based scheduling Ø Real-time systems: earliest deadline first (EDF) Multi-level queue (priority classes) Ø System processes >faculty processes >student processes Multi-level feedback queues: short à long quantum 20
21 Inter-Process Communication (IPC) Processes within a system may be independent or cooperating! Cooperating process can affect or be affected by other processes" Reasons for cooperating processes:" Ø Information sharing, e.g., sharing a file" Ø Computation speedup, e.g., subtasks for parallelism" Ø Modularity & Convenience ( e.g., editing, printing in the same time)" Cooperating processes need inter-process communication (IPC)" Ø Shared memory" Ø Pipe and Named Pipe" Ø Message passing" "
22 Shared Memory, Pros and Cons Pros Ø Fast bidirectional communication among any number of processes Ø Saves Resources Cons Ø Needs concurrency control (leads to data inconsistencies like Lost update ) Ø Lack of data protection from Operating System (OS)
23 Ordinary Pipes Ordinary Pipes allow communication in standard producer-consumer style Producer writes to one end (the write-end of the pipe) Consumer reads from the other end (the read-end of the pipe) Ordinary pipes are therefore unidirectional Require parent-child/sibling relationship between communicating processes
24 Named Pipes (FIFO) Named Pipes are more powerful than ordinary pipes " Communication is bidirectional " No parent-child/sibling relationship is necessary between the communicating processes " Several processes can use the named pipe for communication " Provided on both UNIX and Windows systems"
25 Lecture03: Thread and Implementation Motivation and thread basics Ø Resources requirements: thread vs. process Thread implementations Ø User threads: e.g., Pthreads and Java threads Ø Kernel threads: e.g., Linux tasks Ø Map user- and kernel-level threads Ø Lightweight process and scheduler activation Other issues with threads: process creation and signals etc. Threaded programs Ø Thread pool Ø Performance vs. number of threads vs. CPUs and I/Os CS5523: Operating UTSA 25
26 Thread vs. Process Responsiveness Ø Part of blocked Resource Sharing Ø Memory, open files, etc. Economy Ø Creation and switches Scalability Ø Increase parallelism Department of Computer UTSA 26
27 Threads vs. Processes Threads and processes: similarities Ø Each has its own logical control flow Ø Each can run concurrently with others Ø Each is context switched (scheduled) by the kernel Threads and processes: differences Ø Threads share code and data, processes (typically) do not Ø Threads are less expensive than processes ü Process control (creation and exit) is more expensive as thread control ü Context switches: processes are more expensive than for threads Ø Signal handler: shared or separate
28 Pros and Cons of Thread-Based Designs + Easy to share data structures between threads Ø e.g., logging information, file cache + Threads are more efficient than processes Unintentional sharing can introduce subtle and hard-toreproduce errors!
29 Multithreading Models: Pros and Cons Many-to-one One-to-one Many-to-many
30 Pthreads: POSIX Thread POSIX Ø Portable Operating System Interface [for Unix] Ø Standardized programming interface Pthreads Ø Thread implementations adhering to POSIX standard Ø API specifies behavior of the thread library: defined as a set of C types and procedure calls Ø Common in UNIX OS (Solaris, Linux, Mac OS X) Support for thread creation and synchronization Department of Computer UTSA 30
31 Linux Threads Linux uses the term task (rather than process or thread) when referring to a flow of control Linux provides clone() system call to create threads Ø A set of flags, passed as arguments to the clone() system call determine how much sharing is involved (e.g. open files, memory space, etc.) Linux: 1-to-1 thread mapping Ø NPTL (Native POSIX Thread Library) Department of Computer UTSA 31
32 Threads Memory Model Conceptual model: Ø Multiple threads run in the same context of a process Ø Each thread has its own separate thread context ü Thread ID, stack, stack pointer, PC, and GP registers Ø All threads share the remaining process context ü Code, data, heap, and shared library segments ü Open files and installed handlers Operationally, this model is not strictly enforced: Ø Register values are truly separate and protected, but Ø Any thread can read and write the stack of any other thread
33 Mapping Variable Instances to Memory Global var: 1 instance (ptr [data]) char **ptr; /* global */ int main() { int i; pthread_t tid; char *msgs[2] = { "Hello from foo", "Hello from bar" }; ptr = msgs; } for (i = 0; i < 2; i++) Pthread_create(&tid, NULL, thread, (void *)i);. Local vars: 1 instance (i.m, msgs.m) Local var: 2 instances ( myid.p0 [peer thread 0 s stack], myid.p1 [peer thread 1 s stack] ) /* thread routine */ void *thread(void *vargp) { int myid = (int)vargp; static int cnt = 0; } sharing.c! printf("[%d]: %s (svar=%d)\n", myid, ptr[myid], ++cnt); Local sta-c var: 1 instance (cnt [data])
34 Thread Pool Pool of threads Ø Threads in a pool where they wait for work Advantages: Ø Usually slightly faster to service a request with an existing thread than create a new thread Ø Allows the number of threads in the application(s) to be bound to the size of the pool Adjust thread number in pool Ø According to usage pattern and system load Department of Computer UTSA 34
35 Performance of Threaded Programs Suppose that the processing of each request Ø Takes X seconds for computation; and Ø Takes Y seconds for reading data from I/O disk For single-thread program/process Ø A single CPU & single disk system Ø What is the maximum throughput (i.e., the number of requests can be processed per second)? Example: suppose that each request takes 2ms for computation 8ms to read data from disk 1000/10ms = 100 Department of Computer UTSA 35
36 Lecture04: Concurrency and Synchronization Problems with concurrent access to shared data Ø Race condition and critical section Ø General structure for enforce critical section Synchronization mechanism Ø Hardware supported instructions: e.g., TestAndSet Ø Software solution: e.g., semaphore Classical Synchronization Problems High-level synchronization structure: Monitor Case study for synchronization Ø Pthread library: mutex and conditional variables Ø Java inherit monitor and conditional variable CS5523: Operating UTSA 36
37 Race Conditions Multiple processes/threads write/read shared data and the outcome depends on the particular order to access shared data are called race conditions Ø A serious problem for concurrent system using shared variables! How do we solve the problem?! Need to make sure that some high-level code sections are executed atomically Ø Atomic operation means that it completes in its entirety without worrying about interruption by any other potentially conflictcausing process Department of Computer UTSA 37
38 Critical-Section (CS) Problem Multiple processes/threads compete to use some shared data critical section (critical region): a piece of code that accesses a shared resource (data structure or device) that must not be concurrently accessed by more than one thread of execution. Problem ensure that only one process/thread is allowed to execute in its critical section (for the same shared data) at any time. The execution of critical sections must be mutually exclusive in time. Department of Computer UTSA 38
39 Solving the Critical-Section Problem Mutual Exclusion Ø No two processes can simultaneously enter into the critical section. Bounded Waiting Ø No process should wait forever to enter a critical section. Progress Ø Non-related process can not block a process trying to enter one critical section Relative Speed Ø No assumption can be made about the relative speed of different processes (though all processes have a non-zero speed). Department of Computer UTSA 39
40 General Structure for Critical Sections do { entry section critical section exit section remainder statements } while (1); In the entry section, the process requests permission. Department of Computer UTSA 40
41 Solutions for CS Problem Software based" Ø Peterson s solution" Ø Semaphores" Ø Monitors" Hardware based " Ø Locks" Ø disable interrupts" Ø Atomic instructions: TestAndSet and Swap Department of Computer UTSA 41
42 Semaphores Synchronization without busy waiting Ø Motivation: Avoid busy waiting by blocking a process execution until some condition is satisfied Semaphore S integer variable Two indivisible (atomic) operations: how? à later Ø wait(s) (also called P(s) or down(s) or acquire()); Ø signal(s) (also called V(s) or up(s) or release()) Ø User-visible operations on a semaphore Ø Easy to generalize, and less complicated for application programmers" Department of Computer UTSA 42
43 Semaphore Usage Counting semaphore integer value can range over an unrestricted domain" Ø Can be used to control access to a given resources with finite number of instances " Binary semaphore integer value can range only between 0 and 1; Also known as mutex locks! " S = number of resources while(1){ } mutex = 1 while(1){ } wait(s); use one of S resource signal(s); remainder section wait(mutex); Critical Section signal(mutex); remainder section
44 Monitors High-level synchronization construct (implement in different languages) that provided mutual exclusion within the monitor AND the ability to wait for a certain condition to become true monitor monitor-name{ shared variable declarations procedure body P1 ( ) {...} procedure body P2 ( ) {...} procedure body Pn ( ) {...} {initialization codes; } } Department of Computer UTSA 44
45 monitors vs. semaphores A Monitor: Ø An object designed to be accessed across threads Ø Member functions enforce mutual exclusion A Semaphore: Ø A low-level object Ø We can use semaphore to implement a monitor Department of Computer UTSA 45
46 Binary Semaphore and Mutex Lock? Binary Semaphore: Ø No ownership Mutex lock Ø Only the owner of a lock can release a lock. Ø Priority inversion safety: potentially promote a task Ø Deletion safety: a task owning a lock can t be deleted. 46
47 Types of questions on Midterm1 Question answering: Ø Example: What is a system call? Problem Analysis: Ø Example: drawing the Gantt chart for FIFO CS5523: Operating UTSA 47
CS 5523 Operating Systems: Midterm II - reivew Instructor: Dr. Tongping Liu Department Computer Science The University of Texas at San Antonio
CS 5523 Operating Systems: Midterm II - reivew Instructor: Dr. Tongping Liu Department Computer Science The University of Texas at San Antonio Fall 2017 1 Outline Inter-Process Communication (20) Threads
More informationCS3733: Operating Systems
Outline CS3733: Operating Systems Topics: Synchronization, Critical Sections and Semaphores (SGG Chapter 6) Instructor: Dr. Tongping Liu 1 Memory Model of Multithreaded Programs Synchronization for coordinated
More informationCS 3723 Operating Systems: Final Review
CS 3723 Operating Systems: Final Review Outline Threads Synchronizations Pthread Synchronizations Instructor: Dr. Tongping Liu 1 2 Threads: Outline Context Switches of Processes: Expensive Motivation and
More informationCS 3733 Operating Systems
What will be covered in MidtermI? CS 3733 Operating Systems Instructor: Dr. Tongping Liu Department Computer Science The University of Texas at San Antonio Basics of C programming language Processes, program
More informationCS 3723 Operating Systems: Final Review
CS 3723 Operating Systems: Final Review Instructor: Dr. Tongping Liu Lecture Outline High-level synchronization structure: Monitor Pthread mutex Conditional variables Barrier Threading Issues 1 2 Monitors
More informationCS 5523 Operating Systems: Thread and Implementation
When in the Course of human events, it becomes necessary for one people to dissolve the political bands which have connected them with another, and to assume among the powers of the earth, the separate
More informationCHAPTER 2: PROCESS MANAGEMENT
1 CHAPTER 2: PROCESS MANAGEMENT Slides by: Ms. Shree Jaswal TOPICS TO BE COVERED Process description: Process, Process States, Process Control Block (PCB), Threads, Thread management. Process Scheduling:
More informationCS Operating Systems: Threads (SGG 4)
When in the Course of human events, it becomes necessary for one people to dissolve the political bands which have connected them with another, and to assume among the powers of the earth, the separate
More informationLecture 2 Process Management
Lecture 2 Process Management Process Concept An operating system executes a variety of programs: Batch system jobs Time-shared systems user programs or tasks The terms job and process may be interchangeable
More informationECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective. Part I: Operating system overview: Processes and threads
ECE 7650 Scalable and Secure Internet Services and Architecture ---- A Systems Perspective Part I: Operating system overview: Processes and threads 1 Overview Process concept Process scheduling Thread
More informationOverview of Operating Systems
Lecture Outline Overview of Operating Systems Instructor: Dr. Tongping Liu Operating System: what is it? Evolution of Computer Systems and OS Concepts Different types/variations of Systems/OS Ø Parallel/distributed/real-time/embedded
More informationSynchronization: Basics
Synchronization: Basics 53: Introduction to Computer Systems 4 th Lecture, April 8, 7 Instructor: Seth Copen Goldstein, Franz Franchetti Today Threads review Sharing Mutual exclusion Semaphores Traditional
More informationProcesses Prof. James L. Frankel Harvard University. Version of 6:16 PM 10-Feb-2017 Copyright 2017, 2015 James L. Frankel. All rights reserved.
Processes Prof. James L. Frankel Harvard University Version of 6:16 PM 10-Feb-2017 Copyright 2017, 2015 James L. Frankel. All rights reserved. Process Model Each process consists of a sequential program
More informationCS 333 Introduction to Operating Systems. Class 3 Threads & Concurrency. Jonathan Walpole Computer Science Portland State University
CS 333 Introduction to Operating Systems Class 3 Threads & Concurrency Jonathan Walpole Computer Science Portland State University 1 The Process Concept 2 The Process Concept Process a program in execution
More informationCSC Operating Systems Spring Lecture - XII Midterm Review. Tevfik Ko!ar. Louisiana State University. March 4 th, 2008.
CSC 4103 - Operating Systems Spring 2008 Lecture - XII Midterm Review Tevfik Ko!ar Louisiana State University March 4 th, 2008 1 I/O Structure After I/O starts, control returns to user program only upon
More informationSynchronization: Basics
Synchronization: Basics CS 485G6: Systems Programming Lecture 34: 5 Apr 6 Shared Variables in Threaded C Programs Question: Which variables in a threaded C program are shared? The answer is not as simple
More informationCS 333 Introduction to Operating Systems. Class 3 Threads & Concurrency. Jonathan Walpole Computer Science Portland State University
CS 333 Introduction to Operating Systems Class 3 Threads & Concurrency Jonathan Walpole Computer Science Portland State University 1 Process creation in UNIX All processes have a unique process id getpid(),
More informationCS370 Operating Systems Midterm Review
CS370 Operating Systems Midterm Review Yashwant K Malaiya Fall 2015 Slides based on Text by Silberschatz, Galvin, Gagne 1 1 What is an Operating System? An OS is a program that acts an intermediary between
More informationCOP 4610: Introduction to Operating Systems (Spring 2016) Chapter 3: Process. Zhi Wang Florida State University
COP 4610: Introduction to Operating Systems (Spring 2016) Chapter 3: Process Zhi Wang Florida State University Contents Process concept Process scheduling Operations on processes Inter-process communication
More informationUNIT 2 Basic Concepts of CPU Scheduling. UNIT -02/Lecture 01
1 UNIT 2 Basic Concepts of CPU Scheduling UNIT -02/Lecture 01 Process Concept An operating system executes a variety of programs: **Batch system jobs **Time-shared systems user programs or tasks **Textbook
More informationOverview of Operating Systems
Lecture Outline Overview of Operating Systems Instructor: Dr. Tongping Liu Thank Dr. Dakai Zhu and Dr. Palden Lama for providing their slides. 1 2 Lecture Outline Von Neumann Architecture 3 This describes
More informationCarnegie Mellon. Bryant and O Hallaron, Computer Systems: A Programmer s Perspective, Third Edition
Synchronization: Basics 53: Introduction to Computer Systems 4 th Lecture, November 6, 7 Instructor: Randy Bryant Today Threads review Sharing Mutual exclusion Semaphores 3 Traditional View of a Process
More informationChapter 3: Processes. Operating System Concepts 8th Edition
Chapter 3: Processes Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication in Client-Server Systems 3.2 Objectives
More informationToday. Threads review Sharing Mutual exclusion Semaphores
SYNCHRONIZATION Today Threads review Sharing Mutual exclusion Semaphores Process: Traditional View Process = process context + code, data, and stack Process context Program context: Data registers Condition
More informationOperating Systems Comprehensive Exam. Spring Student ID # 3/16/2006
Operating Systems Comprehensive Exam Spring 2006 Student ID # 3/16/2006 You must complete all of part I (60%) You must complete two of the three sections in part II (20% each) In Part I, circle or select
More informationCS604 - Operating System Solved Subjective Midterm Papers For Midterm Exam Preparation
CS604 - Operating System Solved Subjective Midterm Papers For Midterm Exam Preparation The given code is as following; boolean flag[2]; int turn; do { flag[i]=true; turn=j; while(flag[j] && turn==j); critical
More informationProcesses and Threads
TDDI04 Concurrent Programming, Operating Systems, and Real-time Operating Systems Processes and Threads [SGG7] Chapters 3 and 4 Copyright Notice: The lecture notes are mainly based on Silberschatz s, Galvin
More informationThreads. What is a thread? Motivation. Single and Multithreaded Processes. Benefits
CS307 What is a thread? Threads A thread is a basic unit of CPU utilization contains a thread ID, a program counter, a register set, and a stack shares with other threads belonging to the same process
More informationOPERATING SYSTEMS. UNIT II Sections A, B & D. An operating system executes a variety of programs:
OPERATING SYSTEMS UNIT II Sections A, B & D PREPARED BY ANIL KUMAR PRATHIPATI, ASST. PROF., DEPARTMENT OF CSE. PROCESS CONCEPT An operating system executes a variety of programs: Batch system jobs Time-shared
More informationCS3733: Operating Systems
CS3733: Operating Systems Topics: Process (CPU) Scheduling (SGG 5.1-5.3, 6.7 and web notes) Instructor: Dr. Dakai Zhu 1 Updates and Q&A Homework-02: late submission allowed until Friday!! Submit on Blackboard
More informationSubject: Operating System (BTCOC403) Class: S.Y.B.Tech. (Computer Engineering)
A. Multiple Choice Questions (60 questions) Subject: Operating System (BTCOC403) Class: S.Y.B.Tech. (Computer Engineering) Unit-I 1. What is operating system? a) collection of programs that manages hardware
More informationThreads (SGG 4) Outline. Traditional Process: Single Activity. Example: A Text Editor with Multi-Activity. Instructor: Dr.
When in the Course of human events, it becomes necessary for one people to dissolve the political bands which have connected them with another, and to assume among the powers of the earth, the separate
More informationOperating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy
Operating Systems Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com Email : eaymanelshenawy@yahoo.com Reference
More informationProcesses. Process Concept
Processes These slides are created by Dr. Huang of George Mason University. Students registered in Dr. Huang s courses at GMU can make a single machine readable copy and print a single copy of each slide
More informationChapter 3: Process Concept
Chapter 3: Process Concept Chapter 3: Process Concept Process Concept Process Scheduling Operations on Processes Inter-Process Communication (IPC) Communication in Client-Server Systems Objectives 3.2
More informationChapter 3: Process Concept
Chapter 3: Process Concept Chapter 3: Process Concept Process Concept Process Scheduling Operations on Processes Inter-Process Communication (IPC) Communication in Client-Server Systems Objectives 3.2
More informationOS 1 st Exam Name Solution St # (Q1) (19 points) True/False. Circle the appropriate choice (there are no trick questions).
OS 1 st Exam Name Solution St # (Q1) (19 points) True/False. Circle the appropriate choice (there are no trick questions). (a) (b) (c) (d) (e) (f) (g) (h) (i) T_ The two primary purposes of an operating
More informationCS 370 Operating Systems
NAME S.ID. # CS 370 Operating Systems Mid-term Example Instructions: The exam time is 50 minutes. CLOSED BOOK. 1. [24 pts] Multiple choice. Check one. a. Multiprogramming is: An executable program that
More informationChapter 3: Process Concept
Chapter 3: Process Concept Silberschatz, Galvin and Gagne 2013! Chapter 3: Process Concept Process Concept" Process Scheduling" Operations on Processes" Inter-Process Communication (IPC)" Communication
More informationCarnegie Mellon Concurrency and Synchronization
Concurrency and Synchronization CMPSCI 3: Computer Systems Principles int pthread_join (pthread_t thread, void **value_ptr) { int result; ptw3_thread_t * tp = (ptw3_thread_t *) thread.p; if (NULL == tp
More informationCS 3723 Operating Systems: Midterm II - Review
CS 3723 Operating Systems: Midterm II - Review Instructor: Dr Tongping Liu Memory Management: Outline Background Swapping Contiguous Memory Allocation and Fragmentation Paging Structure of the Page Table
More informationProcess. Program Vs. process. During execution, the process may be in one of the following states
What is a process? What is process scheduling? What are the common operations on processes? How to conduct process-level communication? How to conduct client-server communication? Process is a program
More informationOperating Systems Comprehensive Exam. Spring Student ID # 3/20/2013
Operating Systems Comprehensive Exam Spring 2013 Student ID # 3/20/2013 You must complete all of Section I You must complete two of the problems in Section II If you need more space to answer a question,
More informationCS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017
CS 471 Operating Systems Yue Cheng George Mason University Fall 2017 Outline o Process concept o Process creation o Process states and scheduling o Preemption and context switch o Inter-process communication
More informationMidterm Exam. October 20th, Thursday NSC
CSE 421/521 - Operating Systems Fall 2011 Lecture - XIV Midterm Review Tevfik Koşar University at Buffalo October 18 th, 2011 1 Midterm Exam October 20th, Thursday 9:30am-10:50am @215 NSC Chapters included
More informationPart V. Process Management. Sadeghi, Cubaleska RUB Course Operating System Security Memory Management and Protection
Part V Process Management Sadeghi, Cubaleska RUB 2008-09 Course Operating System Security Memory Management and Protection Roadmap of Chapter 5 Notion of Process and Thread Data Structures Used to Manage
More informationQ1. State True/false with jusification if the answer is false:
Paper Title: Operating System (IOPS332C) Quiz 1 Time : 1 hr Q1. State True/false with jusification if the answer is false: a. Multiprogramming (having more programs in RAM simultaneously) decreases total
More informationChapter 3: Processes. Operating System Concepts Essentials 8 th Edition
Chapter 3: Processes Silberschatz, Galvin and Gagne 2011 Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication
More informationALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far.
Midterm Exam Reviews ALL the assignments (A1, A2, A3) and Projects (P0, P1, P2) we have done so far. Particular attentions on the following: System call, system kernel Thread/process, thread vs process
More informationTDIU25: Operating Systems II. Processes, Threads and Scheduling
TDIU25: Operating Systems II. Processes, Threads and Scheduling SGG9: 3.1-3.3, 4.1-4.3, 5.1-5.4 o Process concept: context switch, scheduling queues, creation o Multithreaded programming o Process scheduling
More informationCarnegie Mellon. Synchroniza+on : Introduc+on to Computer Systems Recita+on 14: November 25, Pra+k Shah (pcshah) Sec+on C
Synchroniza+on 15-213: Introduc+on to Computer Systems Recita+on 14: November 25, 2013 Pra+k Shah (pcshah) Sec+on C 1 Topics News Shared State Race condi+ons Synchroniza+on Mutex Semaphore Readers- writers
More informationLesson 6: Process Synchronization
Lesson 6: Process Synchronization Chapter 5: Process Synchronization Background The Critical-Section Problem Peterson s Solution Synchronization Hardware Mutex Locks Semaphores Classic Problems of Synchronization
More informationRicardo Rocha. Department of Computer Science Faculty of Sciences University of Porto
Ricardo Rocha Department of Computer Science Faculty of Sciences University of Porto Slides based on the book Operating System Concepts, 9th Edition, Abraham Silberschatz, Peter B. Galvin and Greg Gagne,
More informationCS370 Operating Systems Midterm Review. Yashwant K Malaiya Spring 2019
CS370 Operating Systems Midterm Review Yashwant K Malaiya Spring 2019 1 1 Computer System Structures Computer System Operation Stack for calling functions (subroutines) I/O Structure: polling, interrupts,
More informationConcurrency on x86-64; Threads Programming Tips
Concurrency on x86-64; Threads Programming Tips Brad Karp UCL Computer Science CS 3007 22 nd March 2018 (lecture notes derived from material from Eddie Kohler, David Mazières, Phil Gibbons, Dave O Hallaron,
More informationCS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University
CS 571 Operating Systems Midterm Review Angelos Stavrou, George Mason University Class Midterm: Grading 2 Grading Midterm: 25% Theory Part 60% (1h 30m) Programming Part 40% (1h) Theory Part (Closed Books):
More informationThread. Disclaimer: some slides are adopted from the book authors slides with permission 1
Thread Disclaimer: some slides are adopted from the book authors slides with permission 1 IPC Shared memory Recap share a memory region between processes read or write to the shared memory region fast
More informationProcesses. Overview. Processes. Process Creation. Process Creation fork() Processes. CPU scheduling. Pål Halvorsen 21/9-2005
INF060: Introduction to Operating Systems and Data Communication Operating Systems: Processes & CPU Pål Halvorsen /9-005 Overview Processes primitives for creation and termination states context switches
More informationCHAPTER 3 - PROCESS CONCEPT
CHAPTER 3 - PROCESS CONCEPT 1 OBJECTIVES Introduce a process a program in execution basis of all computation Describe features of processes: scheduling, creation, termination, communication Explore interprocess
More informationIntroduction to PThreads and Basic Synchronization
Introduction to PThreads and Basic Synchronization Michael Jantz, Dr. Prasad Kulkarni Dr. Douglas Niehaus EECS 678 Pthreads Introduction Lab 1 Introduction In this lab, we will learn about some basic synchronization
More informationChapter 4: Threads. Operating System Concepts. Silberschatz, Galvin and Gagne
Chapter 4: Threads Silberschatz, Galvin and Gagne Chapter 4: Threads Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Linux Threads 4.2 Silberschatz, Galvin and
More informationCS3733: Operating Systems
Outline CS3733: Operating Systems Topics: Programs and Processes (SGG 3.1-3.2; USP 2) Programs and Processes States of a process and transitions PCB: Process Control Block Process (program image) in memory
More informationConcurrency, Thread. Dongkun Shin, SKKU
Concurrency, Thread 1 Thread Classic view a single point of execution within a program a single PC where instructions are being fetched from and executed), Multi-threaded program Has more than one point
More informationProcesses. Process Scheduling, Process Synchronization, and Deadlock will be discussed further in Chapters 5, 6, and 7, respectively.
Processes Process Scheduling, Process Synchronization, and Deadlock will be discussed further in Chapters 5, 6, and 7, respectively. 1. Process Concept 1.1 What is a Process? A process is a program in
More informationChapter 3: Processes
Operating Systems Chapter 3: Processes Silberschatz, Galvin and Gagne 2009 Chapter 3: Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication (IPC) Examples of IPC
More informationCMPSCI 377: Operating Systems Exam 1: Processes, Threads, CPU Scheduling and Synchronization. October 9, 2002
Name: Student Id: General instructions: CMPSCI 377: Operating Systems Exam 1: Processes, Threads, CPU Scheduling and Synchronization October 9, 2002 This examination booklet has 10 pages. Do not forget
More informationCHAPTER 6: PROCESS SYNCHRONIZATION
CHAPTER 6: PROCESS SYNCHRONIZATION The slides do not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams. TOPICS Background
More informationMultithreaded Programming
Multithreaded Programming The slides do not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams. September 4, 2014 Topics Overview
More informationExam Guide COMPSCI 386
FOUNDATIONS We discussed in broad terms the three primary responsibilities of an operating system. Describe each. What is a process? What is a thread? What parts of a process are shared by threads? What
More informationProcesses and Threads
OPERATING SYSTEMS CS3502 Spring 2018 Processes and Threads (Chapter 2) Processes Two important types of dynamic entities in a computer system are processes and threads. Dynamic entities only exist at execution
More informationCSCE 313: Intro to Computer Systems
CSCE 313 Introduction to Computer Systems Instructor: Dr. Guofei Gu http://courses.cse.tamu.edu/guofei/csce313/ Programs, Processes, and Threads Programs and Processes Threads 1 Programs, Processes, and
More informationProcesses and Threads
Processes and Threads Giuseppe Anastasi g.anastasi@iet.unipi.it Pervasive Computing & Networking Lab. () Dept. of Information Engineering, University of Pisa Based on original slides by Silberschatz, Galvin
More informationProcesses. CS 475, Spring 2018 Concurrent & Distributed Systems
Processes CS 475, Spring 2018 Concurrent & Distributed Systems Review: Abstractions 2 Review: Concurrency & Parallelism 4 different things: T1 T2 T3 T4 Concurrency: (1 processor) Time T1 T2 T3 T4 T1 T1
More informationPROCESS MANAGEMENT. Operating Systems 2015 Spring by Euiseong Seo
PROCESS MANAGEMENT Operating Systems 2015 Spring by Euiseong Seo Today s Topics Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication
More informationCOP 4610: Introduction to Operating Systems (Spring 2014) Chapter 3: Process. Zhi Wang Florida State University
COP 4610: Introduction to Operating Systems (Spring 2014) Chapter 3: Process Zhi Wang Florida State University Contents Process concept Process scheduling Operations on processes Inter-process communication
More informationChapter 5: Processes & Process Concept. Objectives. Process Concept Process Scheduling Operations on Processes. Communication in Client-Server Systems
Chapter 5: Processes Chapter 5: Processes & Threads Process Concept Process Scheduling Operations on Processes Interprocess Communication Communication in Client-Server Systems, Silberschatz, Galvin and
More informationMARUTHI SCHOOL OF BANKING (MSB)
MARUTHI SCHOOL OF BANKING (MSB) SO IT - OPERATING SYSTEM(2017) 1. is mainly responsible for allocating the resources as per process requirement? 1.RAM 2.Compiler 3.Operating Systems 4.Software 2.Which
More informationProcess. Operating Systems (Fall/Winter 2018) Yajin Zhou ( Zhejiang University
Operating Systems (Fall/Winter 2018) Process Yajin Zhou (http://yajin.org) Zhejiang University Acknowledgement: some pages are based on the slides from Zhi Wang(fsu). Review System calls implementation
More informationTechno India Batanagar Department of Computer Science & Engineering. Model Questions. Multiple Choice Questions:
Techno India Batanagar Department of Computer Science & Engineering Model Questions Subject Name: Operating System Multiple Choice Questions: Subject Code: CS603 1) Shell is the exclusive feature of a)
More informationThreads and Too Much Milk! CS439: Principles of Computer Systems February 6, 2019
Threads and Too Much Milk! CS439: Principles of Computer Systems February 6, 2019 Bringing It Together OS has three hats: What are they? Processes help with one? two? three? of those hats OS protects itself
More informationCSE473/Spring st Midterm Exam Tuesday, February 19, 2007 Professor Trent Jaeger
CSE473/Spring 2008-1st Midterm Exam Tuesday, February 19, 2007 Professor Trent Jaeger Please read the instructions and questions carefully. You will be graded for clarity and correctness. You have 75 minutes
More informationCSCE 313 Introduction to Computer Systems. Instructor: Dezhen Song
CSCE 313 Introduction to Computer Systems Instructor: Dezhen Song Programs, Processes, and Threads Programs and Processes Threads Programs, Processes, and Threads Programs and Processes Threads Processes
More informationCSC 539: Operating Systems Structure and Design. Spring 2006
CSC 539: Operating Systems Structure and Design Spring 2006 Processes and threads process concept process scheduling: state, PCB, process queues, schedulers process operations: create, terminate, wait,
More informationCSC 716 Advanced Operating System Fall 2007 Exam 1. Answer all the questions. The maximum credit for each question is as shown.
CSC 716 Advanced Operating System Fall 2007 Exam 1 Answer all the questions. The maximum credit for each question is as shown. 1. (15) Multiple Choice(3 points for each): 1) Which of the following statement
More informationCS370 Operating Systems
CS370 Operating Systems Colorado State University Yashwant K Malaiya Spring 2018 Lecture 8 Threads and Scheduling Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 FAQ How many threads
More informationCPSC 341 OS & Networks. Processes. Dr. Yingwu Zhu
CPSC 341 OS & Networks 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, but a program is just a file It
More informationSAMPLE MIDTERM QUESTIONS
SAMPLE MIDTERM QUESTIONS CS 143A Notes: 1. These questions are just for you to have some questions to practice. 2. There is no guarantee that there will be any similarities between these questions and
More informationChapter 3: Processes. Operating System Concepts 8th Edition,
Chapter 3: Processes, Administrivia Friday: lab day. For Monday: Read Chapter 4. Written assignment due Wednesday, Feb. 25 see web site. 3.2 Outline What is a process? How is a process represented? Process
More informationChapter 5: Threads. Overview Multithreading Models Threading Issues Pthreads Windows XP Threads Linux Threads Java Threads
Chapter 5: Threads Overview Multithreading Models Threading Issues Pthreads Windows XP Threads Linux Threads Java Threads 5.1 Silberschatz, Galvin and Gagne 2003 More About Processes A process encapsulates
More informationThreads and Too Much Milk! CS439: Principles of Computer Systems January 31, 2018
Threads and Too Much Milk! CS439: Principles of Computer Systems January 31, 2018 Last Time CPU Scheduling discussed the possible policies the scheduler may use to choose the next process (or thread!)
More informationOperating Systems. Figure: Process States. 1 P a g e
1. THE PROCESS CONCEPT A. The Process: A process is a program in execution. A process is more than the program code, which is sometimes known as the text section. It also includes the current activity,
More informationCS 326: Operating Systems. Process Execution. Lecture 5
CS 326: Operating Systems Process Execution Lecture 5 Today s Schedule Process Creation Threads Limited Direct Execution Basic Scheduling 2/5/18 CS 326: Operating Systems 2 Today s Schedule Process Creation
More informationQuestions answered in this lecture: CS 537 Lecture 19 Threads and Cooperation. What s in a process? Organizing a Process
Questions answered in this lecture: CS 537 Lecture 19 Threads and Cooperation Why are threads useful? How does one use POSIX pthreads? Michael Swift 1 2 What s in a process? Organizing a Process A process
More informationReview: Easy Piece 1
CS 537 Lecture 10 Threads Michael Swift 10/9/17 2004-2007 Ed Lazowska, Hank Levy, Andrea and Remzi Arpaci-Dussea, Michael Swift 1 Review: Easy Piece 1 Virtualization CPU Memory Context Switch Schedulers
More informationCS 475. Process = Address space + one thread of control Concurrent program = multiple threads of control
Processes & Threads Concurrent Programs Process = Address space + one thread of control Concurrent program = multiple threads of control Multiple single-threaded processes Multi-threaded process 2 1 Concurrent
More informationCSI3131 Final Exam Review
CSI3131 Final Exam Review Final Exam: When: April 24, 2015 2:00 PM Where: SMD 425 File Systems I/O Hard Drive Virtual Memory Swap Memory Storage and I/O Introduction CSI3131 Topics Process Computing Systems
More informationProcesses-Process Concept:
UNIT-II PROCESS MANAGEMENT Processes-Process Concept: An operating system executes a variety of programs: O Batch system jobs o Time-shared systems user programs or tasks We will use the terms job and
More informationIPC and Unix Special Files
Outline IPC and Unix Special Files (USP Chapters 6 and 7) Instructor: Dr. Tongping Liu Inter-Process communication (IPC) Pipe and Its Operations FIFOs: Named Pipes Ø Allow Un-related Processes to Communicate
More informationChapter 5: Process Synchronization. Operating System Concepts 9 th Edition
Chapter 5: Process Synchronization Silberschatz, Galvin and Gagne 2013 Chapter 5: Process Synchronization Background The Critical-Section Problem Peterson s Solution Synchronization Hardware Mutex Locks
More informationAgenda Process Concept Process Scheduling Operations on Processes Interprocess Communication 3.2
Lecture 3: Processes Agenda Process Concept Process Scheduling Operations on Processes Interprocess Communication 3.2 Process in General 3.3 Process Concept Process is an active program in execution; process
More information