Windows2000-Spr-2001-sect-2-group
Download
Report
Transcript Windows2000-Spr-2001-sect-2-group
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
History
• Built Upon Windows NT 4.0
• Combined Features of Windows 9x and NT
.Coms that Use Windows 2000
•
•
•
•
•
•
•
•
•
•
Barnesandnoble.com
Data Return
InfoSpace.com
Reel.com
CBSMarketWatch.com
Nasdaq.com
Digex
MSNBC.com
Buy.com
THINQ
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
Processor Modes
• User Mode
– Environmental subsystems
– Integral subsystems
• Kernel Mode
– The Executive
– Device Drivers
– Microkernel
– HAL (Hardware Abstraction Layer)
Processing Scheme
• Windows 2000 is a “multi-threaded, multitasking operating system capable of running
on computer systems with multiple
microprocessors.”
• Symmetric multiprocessing
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
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
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.
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.
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.
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.)
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.
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.
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
Thread States
Mutual Exclusion and
Synchronization
• Family of objects
• Two levels
– Kernel
– User mode threads
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
Mutual Exclusion and
Synchronization: User Level
•
•
•
•
Require more synchronization object types
Spinlocks not adequate
Thread requests access to object
Waits
Mutual Exclusion and
Synchronization: Object Types
•
•
•
•
•
Critical section
Mutex
Semaphore
Event
Timer
Memory Management
• Virtual memory system
– Memory Manager
• Paging
– Demand-paging algorithm
File System
• NTFS – Primary File System
• Support for: Fat16, Fat32, CDFS, NFS,
UDF
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
Process Management Data
Structures
•
•
•
•
•
Kernel Process
Process ID
Quota Block
Exception LPC
Debugging LPC
•
•
•
•
•
Access Token
Handle Table
Device Map
PEB
W32PROCESS
Memory Management Data
Structures
• Virtual Address Space Descriptor
• Working Set Information
• Virtual Memory Information
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
Priorities
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
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
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