473,836 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting the number of threads

98 New Member
Visual Basic.net :

is there a way of getting the number of threads?
May 6 '08 #1
6 5031
Frinavale
9,735 Recognized Expert Moderator Expert
Visual Basic.net :

is there a way of getting the number of threads?
I'm not sure what you are asking.
Please provide more information so that we can help you better.

If you have created a Form in .NET and you are retrieving Threads from a Database, you can count the number of rows retrieved....


-Frinny
May 6 '08 #2
Plater
7,872 Recognized Expert Expert
I think you might be confusing the lingo frinny.
I would say that by Thread you are wondering how many threads are running in a given application?

I think you can do this with the Process class (there might be a better way)
Expand|Select|Wrap|Line Numbers
  1. Process.GetCurrentProcess().Threads.Count
  2.  
Should tell you the number of threads in the currently running application (aka your program)
May 6 '08 #3
Frinavale
9,735 Recognized Expert Moderator Expert
I think you might be confusing the lingo frinny.
I would say that by Thread you are wondering how many threads are running in a given application?

I think you can do this with the Process class (there might be a better way)
Expand|Select|Wrap|Line Numbers
  1. Process.GetCurrentProcess().Threads.Count
  2.  
Should tell you the number of threads in the currently running application (aka your program)
You are probably right!
I don't know why I would automatically think Forum Thread *blush*
Too much moderating!
May 6 '08 #4
Gangreen
98 New Member
@Plater: Thanks! That's what I needed.

@Frinavale: a bit overworked maybe :p
May 7 '08 #5
r035198x
13,262 MVP
@OP Realize though that
1.) The threads that you get are operating system threads
2.) The thread count that you get differs for the same program run at different times.
May 7 '08 #6
Gangreen
98 New Member
@OP Realize though that
1.) The threads that you get are operating system threads
2.) The thread count that you get differs for the same program run at different times.
I see...I was already wondering why I got the numbers I got...
These kernel threads probably aren't what I'm looking for.

I would like a way to get a view on how much memory and cpu work it needs...So i can optimise it and have a feedback to what I'm doing is better or worse..
May 7 '08 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

5
30679
by: Tzach | last post by:
I'm developing a simple Java client that runs over a CORBA server. The main client thread is waiting for notification from this server. On each notification, The client creates a new thread executing some logic with the server and close. Each session spend most of the time waiting for the server. At most there can be ~1000 open session. My questions are: 1. How many threads can be open at the same time (with response time of up to ~1...
8
2317
by: andrewpalumbo | last post by:
I'm trying to write some code which will split up a vector into two halves and run a method on the objects in the vector using two seperate threads. I was hoping to see a near linear speedup on an SMP machine, but I'm finding that the code below takes almost exactly the same amount of time as when I iterate through the vector, and don't use any threads at all (using only one processor). I'm running this on a Dual Athlon machine under...
3
5411
by: Ronan Viernes | last post by:
Hi, I have created a python script (see below) to count the maximum number of threads per process (by starting new threads continuously until it breaks). ###### #testThread.py import thread, sys
1
1834
by: Novice | last post by:
Hi all, I have written some code that invokes a method a few hundred times and then it immediately finishes. I would like it to instead: 1. start the hundreds of threads (asynchronously) 2. Then block until all threads have finished executing Currently I have something like the following: -------------- MyClass myObj = new MyClass(initVar);
9
3271
by: Microsoft News Server | last post by:
Hi, I am currently having a problem with random, intermittent lock ups in my ASP.net application on our production server (99% CPU usage by 3 threads, indefinately). I currently use IIS Debug Tools to do a memory dump of the app when the lock up occurs, however the stack information is not very useful. I have just put a new build of our system onto production, and this build is a "Debug" build as opposed to a "Release" build. I am...
10
1698
by: HK | last post by:
With VB.NET 2005, and a Windows Form, running on a dual CPU box, I need to take a recordset (e.g. 100,000 records) and spawn a thread to handle an internet XML transaction routine for each of the records. This is a nice use of threading because those internet requests are going against 3rd party servers that often have 1 second latency problems and so handling them with multiple threads is the fastest way to get through all the records in...
4
6902
by: Amir Shitrit | last post by:
What is the maximum number of threads Windows supports (for all processes), and what's the maximum number of threads available per process? Thanks.
14
1674
by: grabit | last post by:
Hi Peoples I must first, again thank Mary for her help over the last couple of days. I have the following sql that get me all the info i want so far, but have hit a wall when it comes to adding the number of replies per thread. In this statement the posttype refered to is a colum that holds 1 for new threads and 2 for replies. What i need is to rewrite the statement to return me everything i have so far plus a count of replies when the...
15
8417
by: dennis.richardson | last post by:
Greetings all. Here's a problem that's been driving me nuts for the last 48 hours. I'm hoping that someone has come across this before. I have a C# Application that reads a UDP broadcast (asynchronously). Then it repackages these UDP packets and sends them to a subscriber via TCP. Now, I can read the UDP stream all day long without the application
0
9820
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10548
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7792
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6979
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5649
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5826
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4452
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3115
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.