c# - Read Degree Of Parallelism in PLinq extension method -


i'm considering making own plinq extension method provide feature described in recent question: specify task timeout in parallel linq objects. i'd reuse existing .net structure can, including code may specifying degree of parallelism on plinq query.

in below code block i'm specifying degree of parallelism. assuming customforall custom plinq extension method same signature existing forall method, how read degree of parallelism specified on tsource?

private picturelist fetchpictures(list<picture> wallresults)  {                         wallresults             .asparallel()             .withdegreeofparallelism(10)             .customforall(delegate(picture p){ 

unfortunately, isn't supported operation. plinq not designed in manner allows third party extensions, without reverting ienumerable<t>.

the degree of parallelism stored within parallelquery class in private member variable (private querysettings m_specifiedsettings, in int? m_degreeofparallism field).

you could, potentially, use reflection extract that, it's internal implementation detail that's subject change.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -