ConfigureProcessorPool
- Updated2023-02-21
- 2 minute(s) read
int ConfigureProcessorPool (int processorPoolID, unsigned int processorMask, unsigned int *previousProcessorMask);
Purpose
Configures the set of processors included in the specified processor pool.
Processor pool changes take effect the next time the operating system schedules a thread assigned to the pool to run. You can force a thread to give up the remainder of its current timeslice by calling the Windows SDK function Sleep. The next time the thread executes, it reflects the new processor pool settings.
RT This function is supported only on RT systems.
Parameters
| Input | ||
| Name | Type | Description |
| processorPoolID | int | Specifies the processor pool to configure. You must pass kProcessorPool_System. By default, all threads in the system are assigned to the system pool. Operating system threads are always assigned to this pool. The operating system schedules all threads assigned to this pool to the group of processors included in the pool. The operating system automatically moves threads between processors to balance the load between the processors. Note that changes you make to the system processor pool while you debug one RT application persist while you debug subsequent RT applications. National Instruments recommends that you reset the system processor pool to include all processors before you exit any RT application. Rebooting the RT target resets the system processor pool to include all processors. |
| processorMask | unsigned int | Specifies the set of processors to be included in the processor pool. You must specify one or more valid processors. The first processor in the system is indicated by the lowest order bit in the mask. You can determine the total number of processors on the system by calling CmtGetNumProcessors. You cannot specify processors that do not exist on the system. However, you can pass a mask of 0xFFFFFFFF to indicate that the pool should include all available processors regardless of the number of processors on the system. The processor mask for the system pool must always include the first processor. The first processor in the system is unique because it processes all interrupts in the system. |
| Output | ||
| Name | Type | Description |
| previousProcessorMask | unsigned int | Returns the processor mask of the specified pool before making this call. You can pass NULL for this paramter. |
Return Value
| Name | Type | Description |
| status | int | Return value indicating whether the function was successful. Unless otherwise stated, zero indicates successful execution and a negative number indicates that an error occurred. You can call the GetRTUtilErrorString function to obtain a message that describes the error. |
Additional Information
Library: Real-Time Utility Library
Include file: rtutil.h
LabWindows/CVI compatibility: LabWindows/CVI 8.5 and later
Example
Refer to realtime\SymmetricMultiprocessingRT\SymmetricMultiprocessingRT.cws for an example of using the ConfigureProcessorPool function.