Microkernel Objects

The Microkernel manages two types of objects:

Note

The terms mutex and mutant are often confused. In the Windows NT Executive, mutexes are used only in kernel mode. Mutants are used in the Win32 subsystem to implement Win32 API mutexes. For example, the access control object used in the Win32 API, Create Mutex(), is actually a mutant.

Table 5.2 describes how the Executive uses each type of dispatcher object.

Table 5.2 Dispatcher Objects

Object type

Description

Event

Event objects record the occurrence of system and application events and synchronize events with other actions. They enable threads to stop executing until an anticipated event, like an asynchronous file operation, occurs then resume.

Mutant

Mutants control access to code to make sure that only one thread is executing a line of code at a time. Mutants are generally used in user-mode but can also be used in kernel mode.

Mutex

Mutexes also control access to code to make sure that only one thread is executing a line of code at a time. Unlike mutants, mutexes can be used only in kernel mode.

Semaphore

Semaphores are like traffic signals that let through only as many threads as a resource can support. If a resource is fully occupied, the semaphore signals that it is full. When the resource becomes available again, the semaphore signal changes to let more threads in.

Semaphores make it possible for resources to be shared. If semaphore objects are named when they are created, they, too, can be shared by multiple processes.

Thread

Threads are the parts of a process that execute program code. The Microkernel schedules threads to run on processors. The process in which the thread runs determines the virtual address space mapping for the thread and accumulates its run time. A process can have one or many threads. Multiple threads are required for parallel processing, in which different threads of a process run simultaneously on different processors in a single address space.

Timer

Timers record the passage of time and end operations for which time has expired.

Section

Sections represent areas of memory that can be viewed as a contiguous sequence of addresses.


Table 5.3 describes how the Executive uses each type of control object.

Table 5.3 Control Objects

Object type

Description

Asynchronous Procedure Call

Used to break into the execution of a specified thread and to cause a procedure to be called in a specified processor mode.

Interrupt

Used to connect an interrupt source to an interrupt service routine by means of an entry in an Interrupt Dispatch Table (IDT). Each processor has an IDT that is used to dispatch interrupts that occur on that processor.

Process

Used to represent the virtual address space and control information necessary for the execution of a set of thread objects. A process object contains a pointer to an address map, a list of ready threads containing thread objects while the process is not in the balance set, a list of threads that belong to the process, the total accumulated time for all threads executing within the process, a base priority, and a default thread affinity. A process object must be initialized before any thread objects that specify the process as their parent can be initialized.

Profile

Used to measure the distribution of run time within a block of code. Both user and system code can be profiled.


The third and most intricate module that runs in kernel mode is the Executive. The next several sections describe the functions of the Executive and its components.