Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

21
Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman
  • date post

    20-Dec-2015
  • Category

    Documents

  • view

    216
  • download

    2

Transcript of Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Page 1: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Windows 2000 and Solaris: Threads and SMP Management

Submitted by: Rahul Bhuman

Page 2: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Solaris Processes

•Process is an abstraction that contains the environment for a user program

•Each process has a context and various items of state information that define the execution environment of the process

•A process’s context is further divided into a hardware and software context.

•Process contain one or more threads

•Kernel maintains a system wide process table, where by each process is uniquely identified by a positive integer called the process identification number.

Page 3: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Kernel process table

Proces

s

Scheduling class and priority

Process lineage (parents, children)

Signals, handlers, disposition

Process state

Process ID (PID)Process group IDParent process ID

Open files

Credentials (UID, GID)

Hardware context (registers, stack)

Address space

Session information (control terminal, job control state)

CPU(s)

Memory

I/O

The basic process environment, minus the thread abstractions below.

Page 4: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Windows 2000 Process

At the highest level of abstraction, windows 2000 process comprises the following:

•A private virtual address space

•An executable program

•A list of open handles to various system resources that are accessible to all threads in the process.

•A security context called an access token.

•A unique identifier called a process ID

•At least one thread of execution.

Page 5: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Structure of Executive Block

Page 6: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Kennel Process Block

Page 7: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Process Environment Block

Page 8: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Solaris Threads

• User-Level Threads (ULTs)

• Implemented through a threads library in the address space of a process

• Invisible to the OS

• Lightweight processes (LWPs)• A mapping between ULTs and kernel threads• Each LWP supports one or more ULTs and maps to one kernel

thread• Scheduled by the kernel independently• May execute in parallel on multiprocessors

• Kernel threads• Fundamental entities that can be scheduled and dispatched to

run on one of the system processors

Page 9: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Unbound user threads are scheduled within the threads library, where the selected user thread is linked to an available LWP.

Pr oc ess

Pr oc ess

Software context: open file, credential, address space, process group, session control,…

Software context: open file, credential, address space, process group, session control,…

U se r

th re adU se r

th re adU se r

th re ad U se r

th re adU se r

th re adU se r

th re ad

L W P|

Ma

chi

ne

stat eL W P|

Ma

chi

ne

stat e L W P

| M

ach

ine

st

at eL W P|

Ma

chi

ne

stat e

Kt

hr ea d Kt

hr ea d Kt

hr ea d Kt

hr ea d

CPU

Solaris Multithreaded process model

Page 10: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Windows 2000 Threads

A thread is the entity within a process that Windows 2000 schedules for execution.

Thread Includes:•The contents of a set of CPU registers representing the state of the processor

•Two stacks

•A private storage area called thread-local storage (TLS)

•A unique identifier called a thread ID

•Threads sometimes have their own security context

Page 11: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Structure of ETHREAD block

Page 12: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Kernel Thread Block Thread Environment Block (TEB)

Page 13: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Solaris Thread States

Page 14: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Windows 2000 Thread States

Page 15: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Solaris Thread Scheduling

59

0

+60

-60

+60

interrupt

System

ints10

1Real Time

interactive

Time Share

User Range priority

User Range priority

User Range priority

0

169

-60

Class Priority Range Global Priority Range Scheduling Class

0 - 59 000 – 059 Time Share and Interactive

0 – 39 060 – 099 System

0 – 9 100 – 109 Interrupt Threads if the Real time class is not loaded

0 – 59 100 – 159 Real Time

0 – 9 160 – 169 Interrupt threads if the RT class is loaded

Page 16: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Windows 2000 Thread Scheduling

Page 17: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Windows 2000 Symmetric Multiprocessing

Page 18: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Windows 2000 Symmetric Multiprocessing

Windows 2000 is a symmetric multiprocessing (SMP) operating system. There is no master processor.

Windows 2000 incorporates several features that are crucial to its success as a multiprocessor operating system:

•The ability to run operating system code on any available processor and on multiple processors at the same time •Multiple threads of execution within a single process, each of which can execute simultaneously on different processors •Fine-grained synchronization within the kernel as well as within device drivers and server processes, which allows more components to run concurrently on multiple processors

 

Page 19: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

Solaris Symmetric Multiprocessing

1 2 3

1 2 3

1 2 3

1 2 3

1 2 3

1 2 3

A system interconnect, either bus or cross – bar design. Cache – coherent protocol for data transfers to/from memory, processors, and I/O. Very high, sustainable bandwidth with uniform access times (latency)

1 is CPU (s)2 is Memory3 is I/O

                   

A Single Multiprocessor system.Shared memory, symmetric system with uniform memory and I/O access. Single kernel image shared by all processes – single address space view.

Page 20: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

•Solaris supports shared memory architecture, which implements a single kernel shared by all the processors and single uniform memory address space.

•Symmetric Multiprocessor describes a system in which a peer-to-peer relationship exists among all the processors (CPUs) on the system

•All processors are equal

Solaris Symmetric Multiprocessing

Page 21: Windows 2000 and Solaris: Threads and SMP Management Submitted by: Rahul Bhuman.

References

•Solaris Internals – Core Kernel ArchitectureJim Mauro and Richard McDougall

•Inside Microsoft Windows 2000: Third EditionDavid A. Solomon and Mark E.Russinovich

•Operating Systems: Internals and Design PrinciplesWilliam Stallings