Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2005

Tip: Looking for answers? Try searching our database.

Using threads correctly

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Avi Shilon - 30 May 2005 13:01 GMT
Hi guys,

Whenever i need to use threads in my apps, i always
have the same problem of choosing the right kind of
threads to create.
I never know whether to create threads by using:
1) The Thread class, which may create a new os thread
2) A delegate, which uses a thread from the thread pool
3) The ThreadPool, which uses the thread pool as well

Can anyone please shed some light on this subject?

Thanks,
Avi
Jon Skeet [C# MVP] - 30 May 2005 15:27 GMT
> Whenever i need to use threads in my apps, i always
> have the same problem of choosing the right kind of
[quoted text clipped - 5 lines]
>
> Can anyone please shed some light on this subject?

Or 4) using a thread pool other than the system one.

I would suggest only using the system ThreadPool for short operations
which definitely won't need to use the threadpool themselves - it's
easy to deadlock, as the framework libraries don't say which method
calls block on other thread pool threads.

I would usually advocate a custom thread pool or a new thread.

Signature

Jon Skeet - <skeet@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.