Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

31
Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser

Transcript of Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Page 1: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Amanda Johnson

Hannah Young

Josh Taylor

Rich Carroll

Troy Gladhill

Saunders Roesser

Page 2: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Windows 2000 Flavors

• Windows 2000 Professional

• Windows 2000 Server

• Windows 2000 Advanced Server

• Windows 2000 Datacenter Server

Page 3: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

History

• Built Upon Windows NT 4.0

• Combined Features of Windows 9x and NT

Page 4: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

.Coms that Use Windows 2000

• Barnesandnoble.com• Data Return• InfoSpace.com• Reel.com• CBSMarketWatch.com• Nasdaq.com• Digex• MSNBC.com• Buy.com• THINQ

Page 5: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Windows 2000 Features

• File Protection• Driver Certification• Full 32 Bit OS• Reduction in reboots• Internet Integration• Latest Hardware

Support

• SMP

• 4 gig Ram (Pro)

• NTFS

• Multiple Users

• IIS

• Internet Connection Sharing

Page 6: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Processor Modes

• User Mode– Environmental subsystems– Integral subsystems

• Kernel Mode– The Executive– Device Drivers– Microkernel– HAL (Hardware Abstraction Layer)

Page 7: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Processing Scheme

• Windows 2000 is a “multi-threaded, multi-tasking operating system capable of running on computer systems with multiple microprocessors.”

• Symmetric multiprocessing

Page 8: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Processes and Threads • Process: one instance of a running

application and all the memory and other resources associated with it.

• Thread: one path of execution through the application's code.

• Multiple threads per process? – In Windows 2000, a process may contain one

or many threads

Page 9: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Scheduling Threads

• Interrupts (Preemption): used to evenly distribute time amongst the different applications that are running concurrently.

• Concurrency: creates the illusion that the threads are running in parallel for machines with one processor.

• Symmetric Multi-Processing (SMP): used for machines with multiple processors

Page 10: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Consideration for Scheduling

• execution priority: 0 - 31

• Priority 31 reserved for extremely critical tasks (ex. real-time applications)

• Priority 0 used for certain idle-time tasks that are performed only when nothing else is going on.

• Most threads run at priority levels from 7 to 11.

Page 11: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Priority Rules

• High-priority threads are always executed before low-priority threads.

• Threads with low priority never preempt threads with high priority.

• If two or more threads have the same priority, the one that has been executed least recently is executed next.

Page 12: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Watching Threads in Action

• System Monitor: included in Windows 2000 O/S, displays the number of threads currently running on the system.

• Why is the count over 10 when nothing is running other than System Monitor? – The Windows operating system uses threads

itself for things like fault handling etc.

Page 13: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

When Threads Cause Problems

• Two problems– Starvation occurs when one or more threads in

an application are blocked from gaining access to a resource and thus cannot make progress.

– Deadlock occurs when two or more threads are waiting on a condition that cannot be satisfied. (The ultimate form of starvation.)

Page 14: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Dealing with Deadlock in Windows 2000

• Mutual exclusion: designed to guarantee that certain sections of code (critical sections) will not be executed by more than one process simultaneously.

• Spinlocks: mutual exclusion mechanism that stall the processor until a lock is achieved for a critical section.

Page 15: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Avoidance Aid for Programmers

• DLDETECT.EXE – a Win32-based application that can be used to

effectively analyze and design multithreaded applications and to help you detect and eliminate deadlock from your program.

Page 16: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Allowable States

• Process States– No information was available about Windows 2000

Process States

• Thread States– One of six different states:

• Ready• Standby• Running• Waiting• Transition• Terminated

Page 17: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Thread States

Page 18: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Mutual Exclusion and Synchronization

• Family of objects

• Two levels– Kernel– User mode threads

Page 19: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Mutual Exclusion and Synchronization: Kernel

• Must protect global data structures during critical sections

• Uses two techniques– change IRQL– spinlocks

• Spinlocks only for multiprocessor hardware– require ownership

Page 20: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Mutual Exclusion and Synchronization: User Level

• Require more synchronization object types

• Spinlocks not adequate

• Thread requests access to object

• Waits

Page 21: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Mutual Exclusion and Synchronization: Object Types• Critical section

• Mutex

• Semaphore

• Event

• Timer

Page 22: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Memory Management

• Virtual memory system– Memory Manager

• Paging– Demand-paging algorithm

Page 23: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

File System

• NTFS – Primary File System

• Support for: Fat16, Fat32, CDFS, NFS, UDF

Page 24: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

File System Features

• Disk Quota Support• Distributed File

System• Distributed Link

Tracking• Distributed

Authoring and Versioning

• Indexing

• Encrypting File System

• Removable Storage and Remote Storage

• Disk Management• User/Group

Permissions

Page 25: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Process Management Data Structures

• Kernel Process• Process ID• Quota Block• Exception LPC• Debugging LPC

• Access Token• Handle Table• Device Map• PEB• W32PROCESS

Page 26: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Memory Management Data Structures

• Virtual Address Space Descriptor

• Working Set Information

• Virtual Memory Information

Page 27: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Scheduling

• Designed to be highly responsive• Makes use of a priority-driven preemptive

scheduler with a flexible system of priority levels• Priorities in Win2K are organized into two

classes: – Real Time - for threads requiring immediate attention – Variable

• Each class consists of 16 priority levels– Real Time – 16 through 32– Variable – 0 through 15

Page 28: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Priorities

Page 29: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Scheduling Continued

• Threads of lower priority are preempted so the higher priority threads can have access to the processor when they are ready

• In the real time class, where all threads have a fixed priority that never changes, threads of equal priority are in a round-robin queue

• In the variable priority class, a thread’s priority begins at some initial assigned value and then may change, up or down, during the thread’s lifetime – FIFO queue at each priority level, but a process may migrate

to one of the other queues within the variable priority class

Page 30: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Scheduling Continued

• Variable Class– If a thread is interrupted because it has used up

its current time quantum, the Win2K executive lowers its priority

– If a thread is interrupted to wait on an I/O event, the Win2K executive raises its priority

– Interactive threads tend to have the highest priorities within the variable priority class

Page 31: Amanda Johnson Hannah Young Josh Taylor Rich Carroll Troy Gladhill Saunders Roesser.

Multiprocessor Scheduling

• In a multiprocessor system with N processors, the (N-1) highest priority threads are always active, running exclusively on the (N-1) extra processors

• The remaining, lower-priority, threads share the single remaining processor

• However, if a thread is ready to execute but the only available processors are not in its processor affinity set, then that thread is forced to wait and the executive schedules the next available thread