Procesi in niti pri Windows NT. Procesi in niti Primeri sistemskih niti.

Slides:



Advertisements
Similar presentations
Chorus and other Microkernels Presented by: Jonathan Tanner and Brian Doyle Articles By: Jon Udell Peter D. Varhol Dick Pountain.
Advertisements

Operating System Process Scheduling (Ch 4.2, )
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
1 Case Study 2: Windows 2000 Chapter History of windows Programming windows System structure 11.4 Processes and threads in.
Introduction to Operating Systems – Windows process and thread management In this lecture we will cover Threads and processes in Windows Thread priority.
Process Management. External View of the OS Hardware fork() CreateProcess() CreateThread() close() CloseHandle() sleep() semctl() signal() SetWaitableTimer()
CSS430 Case Study (Win XP) These slides were prepared by Professor Kelvin Sung based on the Applied OSC textbook slides (Silberschatz, Galvin, and Gagne).
Introduction to NT Operating system
Chapter 6 Implementing Processes, Threads, and Resources.
© 2004, D. J. Foreman 2-1 Concurrency, Processes and Threads.
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
1 Threads Chapter 4 Reading: 4.1,4.4, Process Characteristics l Unit of resource ownership - process is allocated: n a virtual address space to.
Budapesti Műszaki és Gazdaságtudományi Egyetem Méréstechnika és Információs Rendszerek Tanszék Scheduling in Windows Zoltan Micskei
Slide 6-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 6.
Ceng Operating Systems 11-1 Chapter 11 : Case Study - Win 2000 History of windows 2000 Programming windows 2000 System structure Processes and threads.
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 11 Case Study 2: Windows Vista Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
Chapter 5: CPU Scheduling (Continuation). 5.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Feb 2, 2005 Determining Length.
Windows 2000 Scheduling Computing Department, Lancaster University, UK.
1 Lecture 4: Threads Operating System Fall Contents Overview: Processes & Threads Benefits of Threads Thread State and Operations User Thread.
Process Management. Processes Process Concept Process Scheduling Operations on Processes Interprocess Communication Examples of IPC Systems Communication.
Operating System Examples - Scheduling
Page 110/1/2015 CSE 30341: Operating Systems Principles Windows XP  32-bit preemptive multitasking operating system for Intel microprocessors  Key goals.
Windows 2000 Course Summary Computing Department, Lancaster University, UK.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 2 Processes and Threads Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall,
 2004 Deitel & Associates, Inc. All rights reserved. 1 Chapter 4 – Thread Concepts Outline 4.1 Introduction 4.2Definition of Thread 4.3Motivation for.
CE Operating Systems Lecture 11 Windows – Object manager and process management.
Threads G.Anuradha (Reference : William Stallings)
Processes and Process Control 1. Processes and Process Control 2. Definitions of a Process 3. Systems state vs. Process State 4. A 2 State Process Model.
Traditional UNIX Scheduling Scheduling algorithm objectives Provide good response time for interactive users Ensure that low-priority background jobs do.
System Components ● There are three main protected modules of the System  The Hardware Abstraction Layer ● A virtual machine to configure all devices.
Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.
2 Processor(s)Main MemoryDevices Process, Thread & Resource Manager Memory Manager Device Manager File Manager.
Windows Threading Colin Roby Jaewook Kim.
Silberschatz, Galvin and Gagne ©2011 Operating System Concepts Essentials – 8 th Edition Chapter 2: The Linux System Part 3.
Processes and Threads MICROSOFT.  Process  Process Model  Process Creation  Process Termination  Process States  Implementation of Processes  Thread.
Copyright © Curt Hill More on Operating Systems Continuation of Introduction.
Operating System Examples - Scheduling. References r er/ch10.html r bangalore.org/blug/meetings/200401/scheduler-
Chapter 4 – Thread Concepts
Chapter 3: Windows7 Part 5.
UNIT–II: Process Management
Windows 95 & 98 Steve Boyle Mike Forster Maggie Hamill Nancy O’Brien.
Chapter 4 – Thread Concepts
Process Management Presented By Aditya Gupta Assistant Professor
Operating Systems: A Modern Perspective, Chapter 6
Threads and Locks.
System Structure and Process Model
System Structure and Process Model
Chapter 3: Windows7 Part 2.
Chapter 3: Windows7 Part 5.
System Structure B. Ramamurthy.
Case Study 2: Windows History of windows 2000
System Structure and Process Model
Data center server One of the specification is the size that server will take in a rack. 1U is the smallest size and blade servers, which fit one unit.
Chapter 3: Windows7 Part 2.
Chapter 2: The Linux System Part 3
TDC 311 Process Scheduling.
Process Description and Control
CPU scheduling decisions may take place when a process:
Threads Chapter 4.
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Process Description and Control
Concurrency, Processes and Threads
Chapter 3: Processes.
Implementing Processes, Threads, and Resources
Windows NT History Design Principles System Components
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
CS510 Operating System Foundations
Outline Process Management Process manager Hardware process
Implementing Processes, Threads, and Resources
Presentation transcript:

Procesi in niti pri Windows NT

Procesi in niti

Primeri sistemskih niti

4 konteksti izvajanja kode

Procesi in niti The process has a virtual memory address space, information (such as a base priority), and an affinity for one or more processors. Threads are the unit of execution scheduled by the kernel’s dispatcher. Each thread has its own state, including a priority, processor affinity, and accounting information. A thread can be one of six states: ready, standby, running, waiting, transition, and terminated.

Proces Opisniki virtualnega naslovnega prostora Handle 1 Handle 2 Handle 3 Tabela ročic do objektov Thread x File y Sekcija z Objekti, z dovoljenim dostopom... Dostopni žeton

Virtual address space (including program global storage, heap storage, threads’ stacks)  processes cannot corrupt each other’s address space by mistake Working set (physical memory “owned” by the process) Access token (includes security identifiers) Handle table for Win32 kernel objects These are common to all threads in the process, but separate and protected between processes Vsak proces ima svoje lastno…

Vsaka nit ima svoj … Stack (automatic storage, call frames, etc.) Instance of a top-level function Scheduling state (Wait, Ready, Running, etc.) and priority Current access mode (user mode or kernel mode) Saved CPU state if it isn’t Running Access token (optional -- overrides process’s if present)

Kernel — razvrščanje The dispatcher uses a 32-level priority scheme to determine the order of thread execution. Priorities are divided into two classes. – The real-time class contains threads with priorities ranging from 16 to 31. – The variable class contains threads having priorities from 0 to 15. Characteristics of XP’s priority strategy. – Trends to give very good response times to interactive threads that are using the mouse and windows. – Enables I/O-bound threads to keep the I/O devices busy. – Complete-bound threads soak up the spare CPU cycles in the background.

Kernel — razvrščanje (nadaljevanje.) Scheduling can occur when a thread enters the ready or wait state, when a thread terminates, or when an application changes a thread’s priority or processor affinity. Real-time threads are given preferential access to the CPU; but XP does not guarantee that a real-time thread will start to execute within any particular time limit. (This is known as soft realtime.)

Programmer Interface — Process Management Process is started via the CreateProcess routine which loads any dynamic link libraries that are used by the process, and creates a primary thread. Additional threads can be created by the CreateThread function. Every dynamic link library or executable file that is loaded into the address space of a process is identified by an instance handle.

Process Management (Cont.) Scheduling in Win32 utilizes four priority classes: -IDLE_PRIORITY_CLASS (priority level 4) -NORMAL_PRIORITY_CLASS (level8 — typical for most processes -HIGH_PRIORITY_CLASS (level 13) -REALTIME_PRIORITY_CLASS (level 24) To provide performance levels needed for interactive programs, XP has a special scheduling rule for processes in the NORMAL_PRIORITY_CLASS. – XP distinguishes between the foreground process that is currently selected on the screen, and the background processes that are not currently selected. – When a process moves into the foreground, XP increases the scheduling quantum by some factor, typically 3.

Process Management (Cont.) The kernel dynamically adjusts the priority of a thread depending on whether it is I/O-bound or CPU-bound. To synchronize the concurrent access to shared objects by threads, the kernel provides synchronization objects, such as semaphores and mutexes. – In addition, threads can synchronize by using the WaitForSingleObject or WaitForMultipleObjects functions. – Another method of synchronization in the Win32 API is the critical section.

Process Management (Cont.) A fiber is user-mode code that gets scheduled according to a user-defined scheduling algorithm. – Only one fiber at a time is permitted to execute, even on multiprocessor hardware. – XP includes fibers to facilitate the porting of legacy UNIX applications that are written for a fiber execution model.

Processes and Threads (1) Basic concepts used for CPU and resource management

Processes and Threads (2) Relationship between jobs, processes, threads, and fibers

Razvrščanje pri Windows 2000 Windows 2000 schedules at the thread granularity. Priority-driven, preemptive scheduling system – The highest-priority runnable thread always runs. – Time-sliced, round-robin within a priority level. Windows 2000 uses 32 priority levels – System level (0), Variable levels (1-15), Real-time levels (16-31) From Win32 point of view – Processes are given a priority class upon creation: » Idle, Below Normal, Normal, Above Normal, High, Real-time » Changeable by Task Manager. – The individual threads have a relative priority within the class: » Idle, Lowest, Below-Normal, Normal, Above Normal, Highest, Time-Critical

Prioritete jedra pri Windows 2000

Scheduling (1) Mapping of Win32 priorities to Windows 2000 priorities

Scheduling (2) Windows 2000 supports 32 priorities for threads

An example of priority inversion Scheduling (3)

Job, Process, Thread & Fiber Mgmt. API Calls Some of Win32 calls for managing processes, threads and fibers

CPE je zasedena – zakaj le?

Kateri proces teče?

Process explorer (Sysinternals) Process tree If left justified, parent has exited Disappears if you sort by any column Bring back with View->Show Process Tree Additional details in process list Icon and description (from.EXE) User Name shows domain name Highlight Own, Services Processes Differences highighting Green: new, Red: gone View->Update speed->Paused

32 bitni virtualni naslovni prostor (x86)

Proces in uporaba pomnilnika: “delovna množica”

Zamenjava delovne množice

Podatki o pomnilniku za proces

Souporabljen pomnilnik

Vpogled v delovne množice

Življenje servisa