jeudi 8 septembre 2011 05:25
I've same questions about the document Introduction to TPL Dataflow:
In chapter MaxMessagePerTask I found the following statement:
To address this, the MaxMessagesPerTask option exists. It defaults to DataflowBlockOptions.Unbounded (-1), meaning that there is no maximum
It should be "It defaults to MaxMessagesPerTask = -1, ..", or?
In chapter MaxNumberOfGroups I found the following statement:
By default, the number of groups is DataflowBlockOptions.Unbounded (-1), but it may be explicitly set to a value greater than one.
It should be "By default, the number of groups is MaxNumberOfGroups = -1 ...", or?
In chapter MaxDegreeOfParallelism I found the following statement:
It defaults to 1, meaning only one thing may happen in a block at a time. If set to a value higher than 1, that number of messages may be processed concurrently by the block. If set to DataflowBlockOptions.Unbounded (-1), any number of messages may be processed concurrently, with the maximum automatically managed by the underlying scheduler targeted by the dataflow block.
It should be "If set to MaxDegreeOfParallelism = -1, ", or?
Thanks in advance for clarification.
Toutes les réponses
jeudi 8 septembre 2011 22:50
Thanks for evaluating TPL dataflow and furthermore reading the help doc!
This is an English language issue that I would not try to argue over. I’ll only explain what we’ve meant.
All of these options are of type Int32. Thus there is an Int32 value that has a special meaning. You’ve figured it – that special value is -1. However, we strongly recommend that you use the name constant DataflowBlockOptions.Unbounded to keep your code agnostic of the actual Int32 value.
Thus the text “It defaults to DataflowBlockOptions.Unbounded (-1)” should be read as “It defaults to DataflowBlockOptions.Unbounded which has the value of -1”.
Software Development Engineer, Parallel Computing Platform
This posting is provided "AS IS" with no warranties, and confers no rights.
vendredi 9 septembre 2011 04:34
thanks for clarification this point. Now I've got it. DataflowBlockOptions.Unbounded is "only" a constant. I missed the Options in DataflowBlockOptions and I thought the Unbound(-1) (actually a const not a method) belongs to the BoundedCapacity Option.