Results 1 to 7 of 7
Hi,
I have an application coded in C++ using Linux. How can i know the number of threads in my application? How can i know how many instances of each ...
- 09-04-2008 #1Just Joined!
- Join Date
- Sep 2008
- Posts
- 3
How to determine the number of threads?
Hi,
I have an application coded in C++ using Linux. How can i know the number of threads in my application? How can i know how many instances of each thread are being created?
Thanks & Regards,
Manikanta
- 09-06-2008 #2
You can run "top" and use the "?" to select the username your process/threadds is running. Top will show you the number and what each thread status is.
Hope this helps.
- 09-06-2008 #3Just Joined!
- Join Date
- Jul 2007
- Posts
- 9
well, since you're using c++, you can easily manage all threads and actually just count them using RAII. Keep in mind C++ doesn't have a standard about threads, so you'll either have to dive into pthreads or "emulate" counting using, like i said, RAII or something ilke that.
- 09-07-2008 #4I would have said, "actually just count them using an integer". ;)actually just count them using RAII
But if you want to go with RAII and that term is unfamiliar to you, go here.--
Bill
Old age and treachery will overcome youth and skill.
- 09-07-2008 #5Just Joined!
- Join Date
- Jul 2007
- Posts
- 9
don't worry, i know what i'm talking about. yes, an integer is needed. but if you put every thread inside a class, and make that class destroy when the thread exits, you can use RAII to easily atomically increase and decrease that integer. sounds like a very good OOP design to me
- 09-08-2008 #6Just Joined!
- Join Date
- Sep 2008
- Posts
- 3
- 09-08-2008 #7Just Joined!
- Join Date
- Sep 2008
- Posts
- 3


Reply With Quote
