Getting the number of threads

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gangreen
    New Member
    • Feb 2008
    • 98

    Getting the number of threads

    Visual Basic.net :

    is there a way of getting the number of threads?
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    Originally posted by Gangreen
    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

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      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)
      Code:
      Process.GetCurrentProcess().Threads.Count
      Should tell you the number of threads in the currently running application (aka your program)

      Comment

      • Frinavale
        Recognized Expert Expert
        • Oct 2006
        • 9749

        #4
        Originally posted by Plater
        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)
        Code:
        Process.GetCurrentProcess().Threads.Count
        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!

        Comment

        • Gangreen
          New Member
          • Feb 2008
          • 98

          #5
          @Plater: Thanks! That's what I needed.

          @Frinavale: a bit overworked maybe :p

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #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.

            Comment

            • Gangreen
              New Member
              • Feb 2008
              • 98

              #7
              Originally posted by r035198x
              @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..

              Comment

              Working...