다음을 통해 공유


CurrentScheduler::GetNumberOfVirtualProcessors Method

Returns the current number of virtual processors for the scheduler associated with the calling context.

static unsigned int __cdecl GetNumberOfVirtualProcessors();

Return Value

If a scheduler is associated with the calling context, the current number of virtual processors for that scheduler; otherwise, the value -1.

Remarks

This method will not result in scheduler attachment if the calling context is not already associated with a scheduler.

The return value from this method is an instantaneous sampling of the number of virtual processors for the scheduler associated with the calling context. This value can be stale the moment it is returned.

Requirements

Header: concrt.h

Namespace: concurrency

See Also

Reference

CurrentScheduler Class