c# - Does WebApi's async context trickle down to libraries using TaskParallel? -
i have .net library uses parallelqueryable , parallel.foreach internally parallelize calculations.
now, library being consumed webapi application. know webapi uses async context prevent concurrent access current request. question is, webapi's use of context affect library's internal parallel computations in way (for example continuations have performed on "gui" thread?)?
it wouldn't make sense if tpl behaved way describe. whole point of plinq , parallel.foreach()
execute code in parallel. , using synchronization context (in asp.net or gui application) execute these task
s mean wouldn't execute in parallel. because of that, plinq, parallel.foreach()
, task.run()
don't use synchronization context.
Comments
Post a Comment