TPL Dataflow local storage or something like it
What I'm trying to accomplish is I have a action block with MaxDegreeOfParallelism = 4 . I want to create one local instance of a session object I have for each parallel path, So I want to total of 4 session objects. If this was threads I would creating something like: ThreadLocal<Session> sessionPerThread = new ThreadLocal<Session>(() => new Session()); I know blocks are not threads so I'm looking for something similar but for blocks. Any way to create this? This block is in a service and runs for months on end. During that time period tons of threads are used for each concurrent slot of the