I love knowing how to write programs.

Discussion in 'OT Technology' started by deusexaethera, Apr 6, 2007.

  1. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    I'm defragging a hard drive right now. I'm also calculating playback gains for my entire mp3 collection. I'm also playing some of those mp3s. And browsing the web. And processing some photos in Photoshop.

    I have an Athlon XP 3000, single core. My CPU usage has been pegged at 100% for the last twenty minutes.

    I have no lag whatsoever.

    How? See below.

    [​IMG]

    Some of you will remember this little app of mine; it's been improved a bit since I last posted about it. It can't make my computer faster, but it sure helps it keep its priorities straight. My machine is running better than the dual-Xeon workstations we have at work right now.
     
  2. gnp

    gnp New Member

    Joined:
    Mar 11, 2007
    Messages:
    280
    Likes Received:
    0
    so do you have to launch the thread whose priority you'll set from your app's process or do you have a way to enum running procs and schedule according to a config file?
     
  3. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    It polls the list of running processes 1x a second, which sounds like a lot but it's virtually nothing to a CPU that ticks 2,160,000,000x a second. In the past 14 hours, the GUI has used 29 seconds of CPU time, and the background service that lets it change the priorities and CPU masks of SYSTEM processes has used so little time it doesn't even register in Task Manager. (Speaking of Task Manager, you may have noticed that Task Manager doesn't let you change SYSTEM processes. That's why I wrote the background service.)

    The application stores the settings you program into it and reapplies them the next time the application is launched. Each user gets their own config file by default, but you can point all users to the same file if you want. I do this on our workstations at work to keep our digital mapping software (and MSOutlook) from rendering the machines useless when they're cranking away.

    It's kinda like the CPU Allocator that Tom's Hardware published a few years ago, except it looks nicer, is more flexible, has (limited) scripting capabilities, and generally doesn't suck.

    Someday maybe I'll learn how to get Windows to send an interrupt to the application instead of having to poll the process list, but this works well enough for now.
     
  4. gnp

    gnp New Member

    Joined:
    Mar 11, 2007
    Messages:
    280
    Likes Received:
    0
    what is it written in
     
  5. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    VB6.

    Stop laughing.

    Seriously, why do people ask that question? It's all binary once it gets compiled. Anyway, I have all the VB6 runtime error checks disabled to reduce CPU and RAM footprints and I don't write spaghetti code, so...yeah...I'm going to stop acting all self-conscious and go have a smoke.
     
  6. gnp

    gnp New Member

    Joined:
    Mar 11, 2007
    Messages:
    280
    Likes Received:
    0
    :rofl:

    calm down; i'm on your side, i maintain and convert vb6 to .net daily.


    recently ms decided to open source visual fox pro, and i am hoping in a futile way that they will do the same for vb6. I like the language ok, it just needs a new ide, and support for inheritance, multiple interface implementation, and function pointers as first class types.

    edit: the reason i was curios is that i wrote something similar, a process controller, but with a web interface so that when my rdp and pcanywhere connections got fubar'ed i would have a way to remotely restart their processes
     
  7. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    You know, you could do the same thing by using SRVANY.EXE to launch RDP and pcAnywhere as system services, so the services manager would automatically restart them if they crash. That said, cool idea -- though I'd fear that a hacker would find out how to take advantage of it.

    I really should learn VB.NET. Maybe I can hit you up sometime if/when I port this thing to .NET so it can run in 64-bit.
     
  8. Doc Brown

    Doc Brown Don't make me make you my hobby

    Joined:
    Mar 31, 2006
    Messages:
    16,404
    Likes Received:
    0
    Location:
    Ohio
    I love building a pc that is so smoking fast that I never get to the point where the cpu is tapped out. :mamoru:
     
  9. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,578
    Likes Received:
    3
    :ugh:
     
  10. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    I guess you haven't installed Vista yet.
     
  11. Doc Brown

    Doc Brown Don't make me make you my hobby

    Joined:
    Mar 31, 2006
    Messages:
    16,404
    Likes Received:
    0
    Location:
    Ohio

    Gtfo n00b. I was only busting his chops.
     
  12. Doc Brown

    Doc Brown Don't make me make you my hobby

    Joined:
    Mar 31, 2006
    Messages:
    16,404
    Likes Received:
    0
    Location:
    Ohio

    That is correct sir :eek3:
     
  13. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    :rofl:

    Anyway, I haven't installed Vista either, I'm just glad that it's possible to get such smooth performance out of an older machine like mine just by pushing the programs that really chug into the background so programs that spike can be responsive.
     
  14. Eskimo Yo-Yo

    Eskimo Yo-Yo absent OT Supporter

    Joined:
    Aug 9, 2004
    Messages:
    41,977
    Likes Received:
    17
    nice way to get by
     
  15. Eskimo Yo-Yo

    Eskimo Yo-Yo absent OT Supporter

    Joined:
    Aug 9, 2004
    Messages:
    41,977
    Likes Received:
    17
    I'm running it on a p4 3.0 w/ 2 gigs of ram. I run into problems watching 1080p h.264 ts videos :sadwavey:
     
  16. Supergeek

    Supergeek New Member

    Joined:
    Jan 23, 2007
    Messages:
    1,855
    Likes Received:
    0
    Location:
    Colorado
    deusexaethera, is your app available to the public? I wouldn't mind trying it out; I like to run lots of stuff at the same time.
     
  17. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    or you could use .net and not worry about it?
     
  18. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Technically speaking, yes, but I need to buckle down and create an installer for it. I've got an app that builds installers, I just do so damn much computer stuff at work that I have a hard time motivating myself to do any at home anymore.
     
  19. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Hah! Man, I swear. Vista makes XP look skinny.
     

Share This Page