473,387 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Getting the number of threads

Visual Basic.net :

is there a way of getting the number of threads?
May 6 '08 #1
6 5005
Frinavale
9,735 Expert Mod 8TB
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 Expert 4TB
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 Expert Mod 8TB
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
@Plater: Thanks! That's what I needed.

@Frinavale: a bit overworked maybe :p
May 7 '08 #5
r035198x
13,262 8TB
@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
@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
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...
8
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...
3
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...
1
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....
9
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...
10
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...
4
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
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...
15
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.