c# - How to use TPL's ActionBlock to write to a file? -


i building pipeline in .net tpl goes through bunch of data transformation steps , need write output file. thinking using actionblock write file. however, not sure whether can run problems...e.g. multiple threads trying write same file.

do need worry write contentions? wondering whether idea set executiondataflowblockoptions.maxdegreeofparallelism value higher 1. cause problems?

is there better alternative?

i wondering whether idea set executiondataflowblockoptions.maxdegreeofparallelism value higher 1. cause problems?

yes, could, depending on do. types in .net not thread-safe, means can't use same object multiple threads @ same time. includes system.io objects filestream.

on other hand, if leave maxdegreeofparallelism set 1, shouldn't have issues.


Popular posts from this blog

html/hta mutiple file in audio player -

debugging - Reference - What does this error mean in PHP? -