How to detect a multiprocessor host computer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Altman

    How to detect a multiprocessor host computer

    Hi,

    Is there a way to detect when my program is running on a multiprocessor host
    computer?


  • Ken Tucker [MVP]

    #2
    Re: How to detect a multiprocessor host computer

    Hi,

    I believe you will get more than one record back in mutilprocessor
    systems. Add a reference to system.manageme nt.dll.


    Dim moReturn As Management.Mana gementObjectCol lection

    Dim moSearch As Management.Mana gementObjectSea rcher

    Dim mo As Management.Mana gementObject

    moSearch = New Management.Mana gementObjectSea rcher("Select * from
    Win32_Processor ")

    moReturn = moSearch.Get

    For Each mo In moReturn

    Dim strout As String = String.Format(" {0} - {1}", mo("Name"),
    mo("CurrentCloc kSpeed"))

    Debug.WriteLine (strout)

    Next



    Ken

    ---------------------------
    "Bob Altman" <rda@nospam.com > wrote in message
    news:OvZBWggbFH A.3524@tk2msftn gp13.phx.gbl...
    Hi,

    Is there a way to detect when my program is running on a multiprocessor host
    computer?



    Comment

    • Herfried K. Wagner [MVP]

      #3
      Re: How to detect a multiprocessor host computer

      "Bob Altman" <rda@nospam.com > schrieb:[color=blue]
      > Is there a way to detect when my program is running on a multiprocessor
      > host
      > computer?[/color]

      \\\
      Imports System
      ..
      ..
      ..
      .... = Environment.Get EnvironmentVari able("NUMBER_OF _PROCESSORS")
      ///

      ..NET 2.0: 'Environment.Pr ocessorCount'.

      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://classicvb.org/petition/>

      Comment

      • Bob Altman

        #4
        Re: How to detect a multiprocessor host computer

        Thanks, that's just what I was looking for. It's funny how these things
        work... I just got through reading an article in either CoDe or MSDN
        magazine where the author was touting the benefits of the dreaded WMI
        wrapper classes.

        "Ken Tucker [MVP]" <vb2ae@bellsout h.net> wrote in message
        news:uv5MJlgbFH A.1608@TK2MSFTN GP10.phx.gbl...[color=blue]
        > Hi,
        >
        > I believe you will get more than one record back in mutilprocessor
        > systems. Add a reference to system.manageme nt.dll.
        >
        >
        > Dim moReturn As Management.Mana gementObjectCol lection
        >
        > Dim moSearch As Management.Mana gementObjectSea rcher
        >
        > Dim mo As Management.Mana gementObject
        >
        > moSearch = New Management.Mana gementObjectSea rcher("Select * from
        > Win32_Processor ")
        >
        > moReturn = moSearch.Get
        >
        > For Each mo In moReturn
        >
        > Dim strout As String = String.Format(" {0} - {1}", mo("Name"),
        > mo("CurrentCloc kSpeed"))
        >
        > Debug.WriteLine (strout)
        >
        > Next
        >
        >
        >
        > Ken
        >
        > ---------------------------
        > "Bob Altman" <rda@nospam.com > wrote in message
        > news:OvZBWggbFH A.3524@tk2msftn gp13.phx.gbl...
        > Hi,
        >
        > Is there a way to detect when my program is running on a multiprocessor[/color]
        host[color=blue]
        > computer?
        >
        >
        >[/color]


        Comment

        • Bob Altman

          #5
          Re: How to detect a multiprocessor host computer

          This is even easier than using the System.Manageme nt classes. Thanks![color=blue]
          > Environment.Get EnvironmentVari able("NUMBER_OF _PROCESSORS")[/color]


          Comment

          Working...