ExecutionDataflowBlockOptions.SingleProducerConstrained 属性

定义

获取是否一次使用数据流块将代码受限于某个制造者。Gets whether code using the dataflow block is constrained to one producer at a time.

public:
 property bool SingleProducerConstrained { bool get(); void set(bool value); };
public bool SingleProducerConstrained { get; set; }
member this.SingleProducerConstrained : bool with get, set
Public Property SingleProducerConstrained As Boolean

属性值

Boolean

返回 BooleanReturns Boolean.

注解

此属性的默认值为 false,以便多个创建者可以同时使用该块。This property defaults to false, such that the block may be used by multiple producers concurrently. 仅当使用块的代码可以保证它只被一个 (制造者使用时,才应将此属性设置为 true (例如,一次链接到块) 的源),这意味着将永远不会同时调用601.Offermessage 等方法。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.

适用于