.net - C# parallel and multithreading on single core cpu -


i have application c# , .net 4.5 working on intel core i5 system windows 8.1, when publish application , install on windows 7 sp1 run on system intel pentium 4 single core , single thread .net 4.5.3 application not work completely. portion of code guess cause problem used parallel.foreach .

my application using async await too.

is true parallel.foreach , async await work on multi thread processor?

how can use program on single core? if need replace code should use?

the tpl, parallel.foreach utilizes, works threads rather cores, os schedule threads. single core processor run threads associated parallel.foreach code through single core without issue. async/await methods on other hand not create additional threads, rather run on current synchronization context , use time on thread when method active. again, single core cpu should handle async/await without issue.

that being said, may degrading performance using parallel.foreach due additional overhead associated thread management. if code not cpu bound, parallel.foreach not best approach.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -