Windows.System.Threading.Core
Windows.System.Threading.Core
Windows.System.Threading.Core
Windows.System.Threading.Core
Namespace
Creates work items that run in response to named events and semaphores. Also preallocates resources for work items that must be guaranteed the ability to run, even in circumstances of heavy (or full) resource allocation.
Note
The ThreadPool API is supported for desktop as well as Windows Store apps.
The PreallocatedWorkItem class constructs a work item ahead of time, putting the work item "on standby" so that it can be submitted to the thread pool when it's needed. This is useful in circumstances where the resources available to your app are completely allocated before the work item is needed - for example, calling a deallocation routine that uses a work item. If a work item has already been allocated, the resource deallocation routine can still be called and the PreallocatedWorkItem can still be submitted to the thread pool even if all resources are already in use. Sometimes it is necessary to queue work items in response to named events or semaphores created by Win32 COM objects. You can run a Windows Runtime method in response to a named event or semaphore using a SignalNotifier object. This allows you to write Windows Runtime code that responds to events and signals sent using Win32 and COM for , provided that the event or semaphore has a name. For example, the SignalNotifier can be used to work with Win32 code that's being ported to a Windows Store app.
Preallocated work items are only needed for apps that may use up all available resources, or that need to create work items for resource deallocation routines. Signal notifiers are only applicable to certain apps that use Win32 and COM for . If you don't need to use preallocation or signaling in your app, create work items by using Windows.System.Threading.Note
Classes
| PreallocatedWorkItem PreallocatedWorkItem PreallocatedWorkItem PreallocatedWorkItem |
A preallocated work item is constructed in advance of its submission to the thread pool, ensuring that the work item is constructed so that it can be submitted to the thread pool when necessary. For example, a PreallocatedWorkItem can be created in case it is needed for a resource deallocation routine, since the resource deallocation routine may be called in circumstances when not enough resources would be available to create the work item. NoteThe ThreadPool API is supported for desktop as well as Windows Store apps. |
| SignalNotifier SignalNotifier SignalNotifier SignalNotifier |
Runs a method when an event or semaphore is signaled. A timeout value can also be specified, causing the delegate to run after the time span has elapsed if the named event does not occur (or if the semaphore does not reach a signaled state). NoteThe ThreadPool API is supported for desktop as well as Windows Store apps. |
Delegates
| SignalHandler SignalHandler SignalHandler SignalHandler |
Represents a method that is called when a signal notifier's attached event or semaphore is signaled, or when the optional timeout value has elapsed (whichever comes first). |