ExecutionDataflowBlockOptions::SingleProducerConstrained Property

.NET Framework (current version)

Gets whether code using the dataflow block is constrained to one producer at a time.

Namespace:  System.Threading.Tasks.Dataflow
Assembly:  System.Threading.Tasks.Dataflow (in System.Threading.Tasks.Dataflow.dll)

property bool SingleProducerConstrained {
	bool get ();
	void set (bool value);

Property Value

Type: System::Boolean
Returns Boolean.

This property defaults to false, such that the block may be used by multiple producers concurrently. This property should only be set to true if the code using the block can guarantee that it will only ever be used by one producer (e.g. a source linked to the block) at a time, meaning that methods like Post, Complete, Fault, and OfferMessage will never be called concurrently. Some blocks may choose to capitalize on the knowledge that there will only be one producer at a time in order to provide better performance.

.NET Framework

Supported in: 4.5

Portable Class Library

Supported in: Portable Class Library