Cross-plateform CPU-load code

Accueil Forums Wanted! Cross-plateform CPU-load code

  • Ce sujet contient 3 réponses, 2 participants et a été mis à jour pour la dernière fois par Anonyme, le il y a 9 années et 3 mois.
4 sujets de 1 à 4 (sur un total de 4)
  • Auteur
    Messages
  • #2182 Répondre
    Anonyme
    Inactif

    We’re looking for a sample of code to monitor the CPU-load on Linux, Windows and Mac OS X. The idea is to display the CPU-load (in percent) in IanniX transport bar (like many software does).

    #2569 Répondre
    Anonyme
    Inactif

    I would like to see this feature, but IMHO, this is a potential can of worms and I recommend deferring this feature to a later point in the development of Iannix.

    I believe doing process performance-profiling portably within a multi-platform program like Iannix is one of those esoteric design issues that carries subtle gotchas. Native Instruments seem to have gotten it right in their dual-platform (Mac/Win) Reaktor. But because Max/MSP in their CPU utilization display only counts DSP loading and no control-rate functions, it is often in profound disagreement with the OS’es own profile tool (I’ve seen 200%-500% differences).

    I think all of these variables are design factors in performance monitoring by a single process:

    • number of CPU cores
    • 32bit / 64bit
    • whether high res counters are available, or whether you must depend on the default software tick-counter (some flavors of a given O/S only implement a subset of the API’s counters — think Win32 and the so-called “multimedia counter”).
    • the risk of your own measurements influencing the results (i.e., one’s own process loading the CPU)
    • access rights to performance counters on behalf of the process (e.g., as much as possible, I work under a low-privilege user logon, so programmatic privilege-elevation could be needed)
    • platform portability (Qt implements timers, but I don’t think Qt addresses process-profiling in their API — wouldn’t it be fabulous if I’m wrong!)

    Despite all the buzzwords, I’m not a sysinternals guru and in this case I might be more like Chicken Little. So please take all of this with a pinch of salt.

    Cheers,
    –Bob

    #2570 Répondre
    Anonyme
    Inactif

    Yes Bob, I agree! I started working on it but it is too complex (numbers of CPU, no Qt-API…). That’s why I ask the community for some help!

    However, I didn’t know that MaxMSP CPU usage wasn’t precise 🙂

    What I want is the percentage that Windows (taskmanager), Linux and Mac OS X (with top command) report….

    #2571 Répondre
    Anonyme
    Inactif

    Hi Guillaume, I do understand what you want. Taskmanager is not multiplatform — top is, well, sort of. Writing it initially is one thing, but maintaining all three platform versions of code over the long-term that will likely require you to get closer to the metal (i.e., calling native APIs) over the lifetime of Iannix is yet another (e.g., how different will the Windows-8 API be from the current Win32, for example).

    It’s entirely possible, but it just a imposes a new level of complication you may not need at the moment. That said, I’d love to have it as I often invoke TaskMgr, Profiler, or Activity Monitor (when I can have pretty graphics, I stay away from the command line:–) to check up on Iannix’s overhead.

    Cheers,
    –Chicken Little.

    @Guillaume wrote:

    Yes Bob, I agree! I started working on it but it is too complex (numbers of CPU, no Qt-API…). That’s why I ask the community for some help!

    However, I didn’t know that MaxMSP CPU usage wasn’t precise 🙂

    What I want is the percentage that Windows (taskmanager), Linux and Mac OS X (with top command) report….

4 sujets de 1 à 4 (sur un total de 4)
Répondre à : Cross-plateform CPU-load code
Vos informations:





© IanniX Association

Qu'est-ce que IanniX ? | Téléchargement | Showcase | Forum | Recherche | À propos