Start Free Trial
Come for the solution, stay for everything else.
Start Free Trial
Task parallel with C#
i have infinite loop to do misc jobs
with .NET 2.0, i used thread.QueueUserWorkItem but since .NET 4.0, i use task with :
It works but i read some article that the "task.factory.startnew()" use the new threadpool shipped with .net 4 and this is not for infinite loop because the threadpool can run out of free slot.
that's why i would like to use something that is optimize for multicore programming
do the old "thread.start()" is stilll good to use for multicore programming?
8/22/2022 - Mon
Yes. You can use any approach.
QueueUserWorkItem works as well.
thank you but i read that the "queueuserworkitem" should be avoided since .NET 4
because it uses the "old" threadpool not the new one shipped with the last framework...
am i wrong?
Does not say that on MSDN
Your help has saved me hundreds of hours of internet surfing.
Thank you codecruiser, i read again some articles and here what i understood :
when you compile your app in the framework 2.0, it will use the "old" threadpool shipped with that framework.
When you compile in 3.5 or 4.0, it will use the new threadpool that is optimized for TASK/Parallel and seems that will the QueueUserWorkItem, it has been optimized too for multicore machine
am i right?
ASKER CERTIFIED SOLUTION
Log in or sign up to see answer
Become an EE member today
7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Plans and Pricing
Certified Expert Program
© 1996-2022 Experts Exchange, LLC. All rights reserved. Covered by US Patent