This topic is locked from further discussion.
Not bad.
But i think theres a few major ways you can improve this if you really, really want to make this a pretty cool utility.
1) Make it a windows service with a default setting of auto load balancing.
As a windows service, it doesnt require to be on the lower right corner like various applications do. Also, its not something that has to be regularly accessed really. You should also attempt to hook it to the windows right click memu on .exe's and on the task manager to set basic options and settings.
2) Use WMI (windows management instrumentation) to properly gauge how often and how CPU intensive certain programs actually are.
With WMI you can make very smart decisions about how and when to delegate processes and task to different cores automatically. Obviously this will be harder to code, but it makes it significantly easier on the user becuase theres no settingup of information and tasks to get immediate use out of it. A dedicated interface to manage this, like the one your program has right now, is great for tweaker - not so great for your average user.
Also, if you do plan to use WMI, make sure to make note if any application is truly using multiple cores to good use and to offload work. Its possible that a user of your program may have unknowingly set a game like Supreme Commander to use only core #2 and then complain about poor performance when the truth is that a game like SC takes advantage of multiple cores quite well. With WMI and auto load balancing you just off load a game like SC to cores 3 and 4, or 2, 3 and 4. Obviously you'll want to allow some way to force the use of just one and only one core.
3) Start with a list of common programs and applications with predefined settings. Browsers, games (maybe just run through a listing of the games in Vista's game explorer), productivity application, etc.
Maybe ask during install (btw, there should probably be an actual, formal install) if the user would like to use predefined settings or would prefer to explicitly manage everything? Of course, youneed to make some tough decisions here when it comes to the predefined portion of stuff. Should an application like Photoshop or 3d modelling programs that WILL make use of 8 cores at 100% easily deserve to be processed on all cores, or on all but one?
4) This one shouldn't be terribly difficult to code provided you used WMI, but you need to be careful: real-time switching of cores and thread priority.
Your program sets the CPU affinity during its launch and remains those settings until its opened again (on a new or another instance). You can code it to switch cores if two more CPU intensive tasks are being ran on the same core. This is, in essence, a true load-balance.
You'll need to be careful, not that it would be hard to figure out when to switch, but that certain programs may not like a sudden switch. For the most part, most programs wouldnt mind or care. But some might. Same goes for changing thread priority. You'll probably never want anything to be set to real-time (the highest priority for thread), but you could try setting priorities higher if multiple cores are loaded up by various programs so you can set precedence. Maybe give higher priority to the window/program that currently has focus?
You'll definitely want to allow the user to enable/disable this real-time switching and probably want it off by default.
Hmm...kinda make me want to start doing this.
It's very cool that you can write a program like this. It's great that you share it with the world. As a programming exercise this is great. As a utility for our inner geek to fiddle with low level OS and hardware decision making it's very fun.
[releases the cynic] As an actual tool to improve performance, this is unlikely to help. The OS and the built in logic in the CPU are far more likely to make good decisions about where a process should run. The people who wrote that logic had much more knowledge about the inner workings of their systems than Joe-user like us. I believe you can find anecdotal incidents of bad process -> core choices and performance bumps. But on average, if you compare performance over time between systems where a defined and tested logic system assigns processes and systems where a relatively uninformed humans makes those decisions the software will win. This is especially true in gaming where the most processor hungry games are (slowly but surely) implementing their own logic to utilize multiple cores. [/cynic back in the box]
It's very cool that you can write a program like this. It's great that you share it with the world. As a programming exercise this is great. As a utility for our inner geek to fiddle with low level OS and hardware decision making it's very fun.
[releases the cynic] As an actual tool to improve performance, this is unlikely to help. The OS and the built in logic in the CPU are far more likely to make good decisions about where a process should run. The people who wrote that logic had much more knowledge about the inner workings of their systems than Joe-user like us. I believe you can find anecdotal incidents of bad process -> core choices and performance bumps. But on average, if you compare performance over time between systems where a defined and tested logic system assigns processes and systems where a relatively uninformed humans makes those decisions the software will win. This is especially true in gaming where the most processor hungry games are (slowly but surely) implementing their own logic to utilize multiple cores. [/cynic back in the box]
giantraddish
Agreed to some extent.
The problem is OS loads all the processes at all the cores. OS will migrate threads for mult-threaded applications from core to core, but what about single threaded applications?
Latest games that are using their own logic to utilize multi cores are, ofcourse, good at it. Such games try to share load among different cores by balancing their different threads to different cores. The problem is such games might not take into account the other parallel running CPU intensive tasks.
Anyhow this application addresses a different scenerio at all. Lets say you have a Q6600. You start 2 instances of some DVD-to-AVI conversion program for converting two 1-hour video DVDs into AVIs. At the same time you run crysis (which is said to use multi cores). You can try it practically and you will see that crysis won't run that smooth and at the same time the FPS gained in the resulted video conversion would be jerky.
In such scenerio, this application really helps. Try it.
Not bad.
But i think theres a few major ways you can improve this if you really, really want to make this a pretty cool utility.
1) Make it a windows service with a default setting of auto load balancing.
As a windows service, it doesnt require to be on the lower right corner like various applications do. Also, its not something that has to be regularly accessed really. You should also attempt to hook it to the windows right click memu on .exe's and on the task manager to set basic options and settings.
2) Use WMI (windows management instrumentation) to properly gauge how often and how CPU intensive certain programs actually are.
With WMI you can make very smart decisions about how and when to delegate processes and task to different cores automatically. Obviously this will be harder to code, but it makes it significantly easier on the user becuase theres no settingup of information and tasks to get immediate use out of it. A dedicated interface to manage this, like the one your program has right now, is great for tweaker - not so great for your average user.
Also, if you do plan to use WMI, make sure to make note if any application is truly using multiple cores to good use and to offload work. Its possible that a user of your program may have unknowingly set a game like Supreme Commander to use only core #2 and then complain about poor performance when the truth is that a game like SC takes advantage of multiple cores quite well. With WMI and auto load balancing you just off load a game like SC to cores 3 and 4, or 2, 3 and 4. Obviously you'll want to allow some way to force the use of just one and only one core.
3) Start with a list of common programs and applications with predefined settings. Browsers, games (maybe just run through a listing of the games in Vista's game explorer), productivity application, etc.
Maybe ask during install (btw, there should probably be an actual, formal install) if the user would like to use predefined settings or would prefer to explicitly manage everything? Of course, youneed to make some tough decisions here when it comes to the predefined portion of stuff. Should an application like Photoshop or 3d modelling programs that WILL make use of 8 cores at 100% easily deserve to be processed on all cores, or on all but one?
4) This one shouldn't be terribly difficult to code provided you used WMI, but you need to be careful: real-time switching of cores and thread priority.
Your program sets the CPU affinity during its launch and remains those settings until its opened again (on a new or another instance). You can code it to switch cores if two more CPU intensive tasks are being ran on the same core. This is, in essence, a true load-balance.
You'll need to be careful, not that it would be hard to figure out when to switch, but that certain programs may not like a sudden switch. For the most part, most programs wouldnt mind or care. But some might. Same goes for changing thread priority. You'll probably never want anything to be set to real-time (the highest priority for thread), but you could try setting priorities higher if multiple cores are loaded up by various programs so you can set precedence. Maybe give higher priority to the window/program that currently has focus?
You'll definitely want to allow the user to enable/disable this real-time switching and probably want it off by default.
Hmm...kinda make me want to start doing this.
XaosII
Thanks for your cool suggestions.
Providing a pre-set configuration list of applications and games is a cool idea and its very easy to implement.
Using this utility as a windows service is also cool but I'm afraid a lot of people will find it difficult if they want to stop such a service.
Providing a true dynamic load balance is very good idea, a little difficult though. However imo as giantraddish posted, achieving a dynamic load balance is a thing that can be done better by the OS. The problem is that migrating processes and/or threads among different cores too often through such application will most probably cause a performance degradation. This happens because of several technical factors like reloading processor cache each time a thread is migrated between cores. Here is a good read at this:
http://www2.cs.ucy.ac.cy/carch/xi/papers/MigrationCAN.pdf
I would want this auto-load-balance thing to be a part of my application and I would see what can I do about it without causing too much performance degrade.
Anyhow this application addresses a different scenerio at all. Lets say you have a Q6600. You start 2 instances of some DVD-to-AVI conversion program for converting two 1-hour video DVDs into AVIs. At the same time you run crysis (which is said to use multi cores). You can try it practically and you will see that crysis won't run that smooth and at the same time the FPS gained in the resulted video conversion would be jerky.
In such scenerio, this application really helps. Try it.
zaigham
This falls pretty squarely in the anecdotal, one-off, test scenario category. That said, you kick ass that you built a tool that allowed you to handle a crazy test case like that and that you put it out there for the world. You deserve acknowledgement and a pat on the back. Kudos.
Thanks for your cool suggestions.Providing a pre-set configuration list of applications and games is a cool idea and its very easy to implement.
Using this utility as a windows service is also cool but I'm afraid a lot of people will find it difficult if they want to stop such a service.
Providing a true dynamic load balance is very good idea, a little difficult though. However imo as giantraddish posted, achieving a dynamic load balance is a thing that can be done better by the OS. The problem is that migrating processes and/or threads among different cores too often through such application will most probably cause a performance degradation. This happens because of several technical factors like reloading processor cache each time a thread is migrated between cores. Here is a good read at this:
http://www2.cs.ucy.ac.cy/carch/xi/papers/MigrationCAN.pdf
I would want this auto-load-balance thing to be a part of my application and I would see what can I do about it without causing too much performance degrade.
zaigham
You're absolutely right, but thats why its so important to deal with WMI. Its what windows uses for its own task bar and performance monitors. Windows does do a job of load balancing when its one program doing multiple threads, but programs themselves don't have load balancing in general. Two programs running at the same time that are CPU intensive (with only one major thread) will clog up core 0 at 100% while leaving other cores hovering at < 1%.
With WMI you can get CPU usage per program, CPU timeslice, program lifetime, and all kind of performance related information. Its probably the best way to get this info without causing any performance degrade.
As for making it a service, i can definitely see what you are saying, except that i think it provides the best middle ground for tweakers (who are certainly aware of services to atleast some extent) and for less tech savvy users. Your utility targets tweakers and its not too practical for non-tweake. Either they dont understand what it does well, or find it too much work. Its part of the reason i argued as a service with defaults. It can work for both kinds of users. But, thats entirely your decision.
EDIT: another middle ground might be making it a service but another entry in the control panel that serves as the UI for managing settings and application profiles.
[QUOTE="mazare"]Error (0xc00000135) if I run this. Any1 can help me?zaigham
This application requires dot net framework 2.0. You can download it for free.
Also how can you expect it to work on your single core athlon 3000+. Just wondering!
I have to update sig :D I have intel quadcore.
Anyway thx for help :D
Please Log In to post.
Log in to comment