Share via


PreallocatedWorkItem Constructors

Definition

Overloads

PreallocatedWorkItem(WorkItemHandler)

Initializes a new work item with a WorkItemHandler delegate, allocating resources for the work item in advance.

PreallocatedWorkItem(WorkItemHandler, WorkItemPriority)

Initializes a new work item with a WorkItemHandler delegate, allocating resources for the work item in advance, and specifies the priority of the work item relative to other work items in the thread pool.

PreallocatedWorkItem(WorkItemHandler, WorkItemPriority, WorkItemOptions)

Initializes a new work item with a WorkItemHandler delegate, allocating resources for the work item in advance, and specifies the priority of the work item relative to other work items in the thread pool. Also specifies how the thread pool will allocate processor time for the work item.

PreallocatedWorkItem(WorkItemHandler)

Initializes a new work item with a WorkItemHandler delegate, allocating resources for the work item in advance.

public:
 PreallocatedWorkItem(WorkItemHandler ^ handler);
 PreallocatedWorkItem(WorkItemHandler const& handler);
public PreallocatedWorkItem(WorkItemHandler handler);
function PreallocatedWorkItem(handler)
Public Sub New (handler As WorkItemHandler)

Parameters

handler
WorkItemHandler

Indicates the method that the preallocated work item will run.

Remarks

In C++, make sure that methods used as WorkItemHandler delegates exhibit agile threading model behavior. Calling a non-agile method from a work item will cause a deadlock to occur.

See also

Applies to

PreallocatedWorkItem(WorkItemHandler, WorkItemPriority)

Initializes a new work item with a WorkItemHandler delegate, allocating resources for the work item in advance, and specifies the priority of the work item relative to other work items in the thread pool.

public:
 PreallocatedWorkItem(WorkItemHandler ^ handler, WorkItemPriority priority);
 PreallocatedWorkItem(WorkItemHandler const& handler, WorkItemPriority const& priority);
public PreallocatedWorkItem(WorkItemHandler handler, WorkItemPriority priority);
function PreallocatedWorkItem(handler, priority)
Public Sub New (handler As WorkItemHandler, priority As WorkItemPriority)

Parameters

handler
WorkItemHandler

Indicates the method that the preallocated work item will run.

priority
WorkItemPriority

The priority of the work item relative to other work items in the thread pool. The value of this parameter can be Low, Normal, or High.

Remarks

See the remarks section of the PreallocatedWorkItem(WorkItemHandler) overload.

See also

Applies to

PreallocatedWorkItem(WorkItemHandler, WorkItemPriority, WorkItemOptions)

Initializes a new work item with a WorkItemHandler delegate, allocating resources for the work item in advance, and specifies the priority of the work item relative to other work items in the thread pool. Also specifies how the thread pool will allocate processor time for the work item.

public:
 PreallocatedWorkItem(WorkItemHandler ^ handler, WorkItemPriority priority, WorkItemOptions options);
 PreallocatedWorkItem(WorkItemHandler const& handler, WorkItemPriority const& priority, WorkItemOptions const& options);
public PreallocatedWorkItem(WorkItemHandler handler, WorkItemPriority priority, WorkItemOptions options);
function PreallocatedWorkItem(handler, priority, options)
Public Sub New (handler As WorkItemHandler, priority As WorkItemPriority, options As WorkItemOptions)

Parameters

handler
WorkItemHandler

Indicates the method that the preallocated work item will run.

priority
WorkItemPriority

The priority of the work item relative to other work items in the thread pool. The value of this parameter can be Low, Normal, or High.

options
WorkItemOptions

If this parameter is set to TimeSliced, the work item runs simultaneously with other time-sliced work items, with each work item receiving a share of processor time. If this parameter is set to None, the work item runs when a worker thread becomes available.

Remarks

See the remarks section of the PreallocatedWorkItem(WorkItemHandler) overload.

See also

Applies to