On 7/16/25 05:04, Gerald Marewo wrote:
>
> I have a basic idea of the WorkStream concept for multi-threading.
>
> However, I am struggling to make sense of the 4th argument to the function
> WorkStream::run, i.e,
>
> std::function<void(const EstimateCopyData &)>()
>
> My understanding is that this is a function from the standard C++ library with
> a template parameter and no input arguments. How is the template parameter
> interpreted here?
Gerald:
the syntax C++ uses is admittedly not helpful, but that argument represents a
function that takes an object of type EstimateCopyData as input and does
something with it. WorkStream in essence takes two functions as argument:
* A function that does the work and puts the results into an intermediate
object
* A function that takes the information from the intermediate object and puts
it into the final place.
The function you mention is the one that does the second operation.
If you want more information: The documentation of the WorkStream class links
to a paper that discusses the design of this class.
Best
W.
--
------------------------------------------------------------------------
Wolfgang Bangerth email:
bang...@colostate.edu
www:
http://www.math.colostate.edu/~bangerth/