Lines Matching refs:to
7 A more flexible solution to limit the number of messages in a flow graph
8 is to use tokens. In a token-based system, a limited number of tokens
9 are available in the graph and a message will not be allowed to enter
12 a new message that will then be allowed to enter.
17 ``join_node``s can be used to create an analogous system. A ``join_node`` has
32 - ``queueing``. This type of policy causes inputs to be matched
33 first-in-first-out; that is, the inputs are joined together to form a
37 - ``reserving``. This type of policy causes the ``join_node`` to do no
38 internally buffering, but instead to consume inputs only when it can
41 those together to form an output tuple.
50 The ``input_node`` and ``buffer_node`` are connected to a reserving ``join_node``.
53 the input from the ``input_node`` when it knows there is also an item to
110 back to the ``buffer_node``. This cycle in the flow graph allows the token
111 to be recycled and paired with another input from the ``input_node``. So
114 buffered in the ``input_node``, awaiting a token to be paired with.
118 use any type for a token, including objects or pointers to arrays.
119 Therefore, unlike in the example above, the ``token_t`` doesn't need to be a
121 essential to the computation. We could, for example, modify the example
122 above to use the big objects themselves as the tokens, removing the need
123 to repeatedly allocate and deallocate them, and essentially create a
124 free list of big objects using a cycle back to the ``buffer_node``.
128 number of explicit calls to ``try_put``, but there are other options. For
129 example, an ``input_node`` could be attached to the input of the
132 optionally put 0 or more outputs to each of its output ports. Using a
133 ``multifunction_node``, you can choose to recycle or not recycle a token, or
138 A token based system is therefore very flexible. You are free to declare
139 the token to be of any type and to inject or remove tokens from the
142 the source, this approach enables you to limit resource consumption