Redigera

Dela via


What's New in Processes and Threads

Windows 7 and Windows Server 2008 R2 include the following new programming elements for processes and threads.

New Capabilities

The 64-bit versions of Windows 7 and Windows Server 2008 R2 support more than 64 logical processors on a single computer. For more information, see Processor Groups.

User-mode scheduling (UMS) is a lightweight mechanism that applications can use to schedule their own threads. For more information, see User-Mode Scheduling.

New Functions

The following new functions are used with processors and processor groups.

Function Description
CreateRemoteThreadEx
Creates a thread that runs in the virtual address space of another process and optionally specifies extended attributes such as processor group affinity.
GetActiveProcessorCount
Returns the number of active processors in a processor group or in the system.
GetActiveProcessorGroupCount
Returns the number of active processor groups in the system.
GetCurrentProcessorNumberEx
Retrieves the processor group and number of the logical processor in which the calling thread is running.
GetLogicalProcessorInformationEx
Retrieves information about the relationships of logical processors and related hardware.
GetMaximumProcessorCount
Returns the maximum number of logical processors that a processor group or the system can have.
GetMaximumProcessorGroupCount
Returns the maximum number of processor groups that the system can have.
GetNumaAvailableMemoryNodeEx
Retrieves the amount of memory that is available in the specified node as a USHORT value.
GetNumaNodeNumberFromHandle
Retrieves the NUMA node associated with the underlying device for a file handle.
GetNumaNodeProcessorMaskEx
Retrieves the processor mask for the specified NUMA node as a USHORT value.
GetNumaProcessorNodeEx
Retrieves the node number of the specified logical processor as a USHORT value.
GetNumaProximityNodeEx
Retrieves the node number as a USHORT value for the specified proximity identifier.
GetProcessGroupAffinity
Retrieves the processor group affinity of the specified process.
GetProcessorSystemCycleTime
Retrieves the cycle time each processor in the specified group spent executing deferred procedure calls (DPCs) and interrupt service routines (ISRs).
GetThreadGroupAffinity
Retrieves the processor group affinity of the specified thread.
GetThreadIdealProcessorEx
Retrieves the processor number of the ideal processor for the specified thread.
QueryIdleProcessorCycleTimeEx
Retrieves the accumulated cycle time for the idle thread on each logical processor in the specified processor group.
SetThreadGroupAffinity
Sets the processor group affinity for the specified thread.
SetThreadIdealProcessorEx
Sets the ideal processor for the specified thread and optionally retrieves the previous ideal processor.

 

The following new functions are used with thread pools.

Function Description
QueryThreadpoolStackInformation
Retrieves the stack reserve and commit sizes for threads in the specified thread pool.
SetThreadpoolCallbackPersistent
Specifies that the callback should run on a persistent thread.
SetThreadpoolCallbackPriority
Specifies the priority of a callback function relative to other work items in the same thread pool.
SetThreadpoolStackInformation
Sets the stack reserve and commit sizes for new threads in the specified thread pool.

 

The following new functions are used with UMS.

Function Description
CreateUmsCompletionList
Creates a UMS completion list.
CreateUmsThreadContext
Creates a UMS thread context to represent a UMS worker thread.
DeleteUmsCompletionList
Deletes the specified UMS completion list. The list must be empty.
DeleteUmsThreadContext
Deletes the specified UMS thread context. The thread must be terminated.
DequeueUmsCompletionListItems
Retrieves UMS worker threads from the specified UMS completion list.
EnterUmsSchedulingMode
Converts the calling thread into a UMS scheduler thread.
ExecuteUmsThread
Runs the specified UMS worker thread.
GetCurrentUmsThread
Returns the UMS thread context of the calling UMS thread.
GetNextUmsListItem
Returns the next UMS thread context in a list of UMS thread contexts.
GetUmsCompletionListEvent
Retrieves a handle to the event associated with the specified UMS completion list.
QueryUmsThreadInformation
Retrieves information about the specified UMS worker thread.
SetUmsThreadInformation
Sets application-specific context information for the specified UMS worker thread.
UmsSchedulerProc
The application-defined UMS scheduler entry point function associated with a UMS completion list.
UmsThreadYield
Yields control to the UMS scheduler thread on which the calling UMS worker thread is running.

 

New Structures

Structure Description
CACHE_RELATIONSHIP
Describes cache attributes.
GROUP_AFFINITY
Contains a processor group-specific affinity, such as the affinity of a thread.
GROUP_RELATIONSHIP
Contains information about processor groups.
NUMA_NODE_RELATIONSHIP
Contains information about a NUMA node in a processor group.
PROCESSOR_GROUP_INFO
Contains the number and affinity of processors in a processor group.
PROCESSOR_NUMBER
Represents a logical processor in a processor group.
PROCESSOR_RELATIONSHIP
Contains information about affinity within a processor group.
SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX
Contains information about the relationships of logical processors and related hardware.
UMS_CREATE_THREAD_ATTRIBUTES
Specifies attributes for a UMS worker thread.
UMS_SCHEDULER_STARTUP_INFO
Specifies attributes for a UMS scheduler thread