4P13 Week 3 Talking Points 1. Process State 2 Process Structure Catagories – Process identification: the PID and the parent PID – Signal state: signals.

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

More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Chapter 3 Process Description and Control
Process Description and Control Module 1.0. Major Requirements of an Operating System Interleave the execution of several processes to maximize processor.
Process Description and Control Chapter 3. Major Requirements of an Operating System Interleave the execution of several processes to maximize processor.
Processes CSCI 444/544 Operating Systems Fall 2008.
CS 311 – Lecture 14 Outline Process management system calls Introduction System calls  fork()  getpid()  getppid()  wait()  exit() Orphan process.
Structure of Processes
1 Process Description and Control Chapter 3. 2 Process Management—Fundamental task of an OS The OS is responsible for: Allocation of resources to processes.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
CSCE 351: Operating System Kernels
Process Management. External View of the OS Hardware fork() CreateProcess() CreateThread() close() CloseHandle() sleep() semctl() signal() SetWaitableTimer()
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.
Ceng Operating Systems Chapter 2.1 : Processes Process concept Process scheduling Interprocess communication Deadlocks Threads.
CS-502 Fall 2006Processes in Unix, Linux, & Windows 1 Processes in Unix, Linux, and Windows CS502 Operating Systems.
CSSE Operating Systems
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Process Description and Control A process is sometimes called a task, it is a program in execution.
Using Two Queues. Using Multiple Queues Suspended Processes Processor is faster than I/O so all processes could be waiting for I/O Processor is faster.
University of Pennsylvania 9/12/00CSE 3801 Multiprogramming CSE 380 Lecture Note 3.
Phones OFF Please Processes Parminder Singh Kang Home:
Process Description and Control
Process Description and Control Chapter 3. Major Requirements of an OS Interleave the execution of several processes to maximize processor utilization.
CE Operating Systems Lecture 5 Processes. Overview of lecture In this lecture we will be looking at What is a process? Structure of a process Process.
Process in Unix, Linux, and Windows CS-3013 A-term Processes in Unix, Linux, and Windows CS-3013 Operating Systems (Slides include materials from.
Introduction to Processes CS Intoduction to Operating Systems.
CSC 501 Lecture 2: Processes. Process Process is a running program a program in execution an “instantiation” of a program Program is a bunch of instructions.
Lecture 5 Process, Thread and Task September 22, 2015 Kyu Ho Park.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-1 Process Concepts Department of Computer Science and Software.
The Structure of Processes (Chap 6 in the book “The Design of the UNIX Operating 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,
1 Chapter 2.1 : Processes Process concept Process concept Process scheduling Process scheduling Interprocess communication Interprocess communication Threads.
REVIEW OF COMMONLY USED DATA STRUCTURES IN OS. NEEDS FOR EFFICIENT DATA STRUCTURE Storage complexity & Computation complexity matter Consider the problem.
ITEC 502 컴퓨터 시스템 및 실습 Chapter 2-1: Process Mi-Jung Choi DPNM Lab. Dept. of CSE, POSTECH.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 3: Processes.
CE Operating Systems Lecture 10 Processes and process management in Linux.
Computer Studies (AL) Operating System Process Management - Process.
System calls for Process management
1 Chapter 4 Processes R. C. Chang. 2 Linux Processes n Each process is represented by a task_struct data structure (task and process are terms that Linux.
Linux Processes Travis Willey Jeff Mihalik. What is a process? A process is a program in execution A process includes: –program counter –stack –data section.
Processes CS 6560: Operating Systems Design. 2 Von Neuman Model Both text (program) and data reside in memory Execution cycle Fetch instruction Decode.
4P13 Week 2 & 3 Talking Points 1. Kernel Processes 2.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
Process Description and Control Chapter 3. Source Modified slides from Missouri U. of Science and Tech.
CSC 660: Advanced Operating Systems
1 Structure of Processes Chapter 6 Process State and Transition Data Structure for Process Layout of System Memory THE DESIGN OF THE UNIX OPERATING SYSTEM.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 2.
System calls for Process management Process creation, termination, waiting.
Chapter 3: Processes. 3.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 3: Processes Process Concept Process Scheduling Operations.
Process Control Management Prepared by: Dhason Operating Systems.
Introduction to Kernel
Processes and threads.
Process Management Process Concept Why only the global variables?
PROCESS MANAGEMENT IN MACH
Structure of Processes
Protection of System Resources
Chapter 3: Processes.
Processes A process is a running program.
Structure of Processes
Linux kernel: Processes, threads and scheduling
Chapter 2: The Linux System Part 2
Process Description and Control
Process Control B.Ramamurthy 2/22/2019 B.Ramamurthy.
Chapter 3: Processes.
Unix Process Control B.Ramamurthy 4/11/2019 B.Ramamurthy.
CS510 Operating System Foundations
Process Description and Control in Unix
Process Description and Control in Unix
Presentation transcript:

4P13 Week 3 Talking Points 1

Process State 2

Process Structure Catagories – Process identification: the PID and the parent PID – Signal state: signals pending delivery and summary of signal actions – Tracing: process tracing information – Timers: real-time timer and CPU-utilization counters Process Substructures – Process-group identification: the process group and the session to which the process belongs – User credentials: the real, effective, and saved user and group identifiers; credentials are described more fully in Chapter 5 3

Process Structure Cont. – Memory management: the structure that describes the allocation of virtual address space used by the process; the virtual-address space and its related structures are described more fully in Chapter 6 – File descriptors: an array of pointers to file entries indexed by the process’s open file descriptors; also, the open file flags and current directory – System call vector: the mapping of system call numbers to actions; in addition to current and deprecated native FreeBSD executable formats, the kernel can run binaries compiled for several other UNIX variants such as Linux and System V Release 4 by providing alternative system call vectors when such environments are requested – Resource accounting: the rlimit structures that describe the utilization of the many resources provided by the system (see Section 3.7) – Statistics: statistics collected while the process is running that are reported when it exits and are written to the accounting file; also includes process timers and profiling information if the latter is being collected – Signal actions: the action to take when a signal is posted to a process – Thread structure: the contents of the thread structure (described at the end of this section) 4

5

6

7

Thread Structure Scheduling: the thread priority, user-mode scheduling priority, recent CPU utilization, and amount of time spent sleeping; the run state of a thread (runnable, sleeping); additional status flags; if the thread is sleeping, the wait channel, the identity of the event for which the thread is waiting (see Section 4.3), and a pointer to a string describing the event TSB (Thread State Block): the user- and kernel-mode execution states Kernel stack: the per-thread execution stack for the kernel Machine state: the machine-dependent thread information 8

9

Resuming a Thread 1. Removes the thread from its turnstile or sleepqueue. If it is the last thread to be awakened, the turnstile or sleepqueue is returned to it. If it is not the last thread to be awakened, a turnstile or sleepqueue from the free list is returned to it. 2. Recomputes the user-mode scheduling priority if the thread has been sleeping longer than one second. 3. If the thread had been blocked on a turnstile, it is placed on the run queue. If the thread had been blocked on a sleepqueue, it is placed on the run queue if it is in a SLEEPING state and if its process is not swapped out of main memory. If the process has been swapped out, the swapin process will be awakened to load it back into memory (see Section 6.12); if the thread is in a STOPPED state, it is not put on a run queue until it is explicitly restarted by a user- level process, either by a ptrace system call (see Section 4.9) or by a continue signal (see Section 4.7). 10

11

12

13 Queue Head, current runnable queue.

Run Thread Queues 1. Ensures that our caller acquired the lock associated with the run queue. 2. Locates a nonempty run queue by finding the location of the first nonzero bit in the rq_status bit vector. If rq_status is zero, there are no threads to run, so selects an idle loop thread. 3. Given a nonempty run queue, removes the first thread on the queue. 4. If this run queue is now empty as a result of removing the thread, clears the appropriate bit in rq_status. 5. Returns the selected thread. 14

Interactivity Score 15 If sleep exceeds runtime. If runtime exceeds sleep time Scaling factor is used to provide enhanced separation between interactive and non-interactive threads.

Fork 1. Allocating and initializing a new process structure for the child process 2. Duplicating the context of the parent (including the thread structure and virtual- memory (resources) for the child process 3. Scheduling the child process to run 16

Fork Copies to Child The process group and session The signal state (ignored, caught, and blocked signal masks) The p_nice scheduling parameter A reference to the parent’s credential A reference to the parent’s set of open files A reference to the parent’s limits 17

Fork sets child parameters The process’s signal-actions structure Zeroing the process’s statistics structure Entry onto the list of all processes Entry onto the child list of the parent and the back pointer to the parent Entry onto the parent’s process-group list Entry onto the hash structure that allows the process to be looked up by its PID A new PID for the process 18

Exit() Canceling any pending timers Releasing virtual-memory resources Closing open descriptors Handling stopped or traced child processes After termination – Usage statistics are processed for accounting. 19

20

21

22

23

24