# of Threads when Multithreading
# of Threads when Multithreading
# of Threads when Multithreading
# of Threads when Multithreading
# of Threads when Multithreading
# of Threads when Multithreading # of Threads when Multithreading # of Threads when Multithreading # of Threads when Multithreading # of Threads when Multithreading # of Threads when Multithreading # of Threads when Multithreading # of Threads when Multithreading
# of Threads when Multithreading # of Threads when Multithreading
# of Threads when Multithreading
Go Back  Xtreme Visual Basic Talk > > > # of Threads when Multithreading


Reply
 
Thread Tools Display Modes
  #1  
Old 04-17-2004, 10:16 PM
tuxp3 tuxp3 is offline
Freshman
 
Join Date: Sep 2003
Posts: 31
Question # of Threads when Multithreading


Hi,
I want to find out the number of threads still active when multithreading. And also, (this is an easy one) how to use Goto and such.
Also, i want a way to stop all the threads running (besides the form)

Thanks, Andrew
Reply With Quote
  #2  
Old 04-18-2004, 08:21 AM
AFterlife's Avatar
AFterlife AFterlife is offline
Contributor
 
Join Date: Dec 2003
Location: Mi
Posts: 654
Default

Quote:
Originally Posted by tuxp3
Hi,
I want to find out the number of threads still active when multithreading. And also, (this is an easy one) how to use Goto and such.
Also, i want a way to stop all the threads running (besides the form)

Thanks, Andrew
http://msdn.microsoft.com/library/de...mthreading.asp
Also if you are using Gotos, that is not good practice. So in other words dont use gotos. In vb6 they were used only to trap errors. However now we have Try CATCH FINALLY blocks. So use those.
Reply With Quote
  #3  
Old 04-18-2004, 06:41 PM
excaliber's Avatar
excaliber# of Threads when Multithreading excaliber is offline
Senior Contributor

* Expert *
 
Join Date: Nov 2002
Location: Ohio, USA
Posts: 1,828
Default

Well, if you stop ALL threads (except yours) that would crash windows. Thus you can't.

Do you want to know how many local threads are running (threads that belong to the application), or the number in windows total?
__________________
RandomIRC - Your neighborhood's friendly IRC channel (irc.randomirc.com - #code)

"Perl - The only language that looks the same before and after RSA encryption."
Reply With Quote
  #4  
Old 04-18-2004, 07:34 PM
tuxp3 tuxp3 is offline
Freshman
 
Join Date: Sep 2003
Posts: 31
Default

Quote:
Originally Posted by excaliber
Well, if you stop ALL threads (except yours) that would crash windows. Thus you can't.

Do you want to know how many local threads are running (threads that belong to the application), or the number in windows total?
to be more specific, threads created by my application. i want to start up a bunch of threads and be able to stop them quickly if i need to. also i want to "limit" the amount of running threads to 40 or 50 so i want a way to find the total number of running threads in the application and then start more if the total doesnt exceed 40 (50) (possible- user control ::self note :: )
Reply With Quote
  #5  
Old 04-18-2004, 08:06 PM
reboot's Avatar
reboot# of Threads when Multithreading reboot is offline
Keeper of foo

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Graceland
Posts: 15,614
Default

Why don't you just increment a counter whenever you start a new thread.
Reply With Quote
  #6  
Old 04-18-2004, 11:40 PM
sgt_pinky's Avatar
sgt_pinky sgt_pinky is offline
Contributor
 
Join Date: Feb 2004
Location: Melbourne, Australia
Posts: 633
Default

How about using a thread pool? eg. Dim tp as Threading.ThreadPool.

Just a suggestion. Never used it myself so can't comment on whether its good, bad, or just plain ugly.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multithreading in VB.Net excaliber Tutors' Corner 2 12-20-2006 05:45 AM
Threading Question - Number of Running Threads? dwilliams .NET General 0 02-12-2004 08:54 AM
Quarantined threads? Jatopian Forum Questions / Concerns / Comments 2 11-14-2003 08:18 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
# of Threads when Multithreading
# of Threads when Multithreading
# of Threads when Multithreading # of Threads when Multithreading
# of Threads when Multithreading
# of Threads when Multithreading
# of Threads when Multithreading # of Threads when Multithreading # of Threads when Multithreading # of Threads when Multithreading # of Threads when Multithreading # of Threads when Multithreading # of Threads when Multithreading
# of Threads when Multithreading
# of Threads when Multithreading
 
# of Threads when Multithreading
# of Threads when Multithreading
 
-->