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 / CLR / April 2005

Tip: Looking for answers? Try searching our database.

.NET Threads

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeff Rockwell - 29 Mar 2005 15:06 GMT
Traditional C++ Windows threading was easy - the HANDLES could be saved when creating the threads so you could kill them or WaitForSingle/Multiple Object to know when one dies, etc.

In .NET, I'm torn between battling the ThreadPool class or creating my own - but I'm stuck on some seemingly simply tasks:
1. Using the threadpool, how do I kill a thread created using the QueueUserWorkItem method? (sometimes my threads can hang)
2. How do I walk all my threads created (above) & determine which are hanging if any (so that I can kill them if needed)
3. If I roll my own threadpool class, how do I monitor threads to know when they complete - without putting extra code/logic into the thread itself (ie I want to be able to use a thread without having to use special signalling etc.) The Thread and ProcessThread classes don't seem to overlap...???

Any help???
zabutimaxim@gmail.com - 17 Apr 2005 15:08 GMT
If you want to monitor threads use array of events
and check their state. But if you want to simulate WaitForSingleObject
use Thread.Join, that will pass after thread finished.

Hope this helps

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.