mersenneforum.org

mersenneforum.org (https://www.mersenneforum.org/index.php)
-   Software (https://www.mersenneforum.org/forumdisplay.php?f=10)
-   -   is there a way (https://www.mersenneforum.org/showthread.php?t=1070)

crash893 2004-02-03 18:10

[QUOTE=PrimeCruncher]Sorry Crash893, I keep getting sidetracked. Haven't had time to program a bloody thing in months. But February Vacation is coming up and I'm going to try to make a conerted effort to get this done.[/QUOTE]


no rush just wanted to know the status

ive got 2 or 3 computers i can test it on as soon as its released

let me know

crash893 2004-03-01 00:19

bump

PrimeCruncher 2004-03-01 00:34

Well, as you can see, February vacation has come and gone. I got more busy than I expected. I've got a very busy schedule this month, but I'll be damned if this isn't done by the end of April!

crash893 2004-04-27 17:47

hey

so just checking up

whats the word

PrimeCruncher 2004-04-27 18:57

1 Attachment(s)
Geez... I'm as bad as Zeke! My 'soon' is less soon than his soon!

Dammit! I completely forgot... which really sucks since I did have time to work on it this vacation... you don't happen to have a time machine so I can go back and tell myself to finish it by any chance?

I wish I could say I'd have time to work on it soon, but I'd be lying if I did. I'm determined to get this done though, so it WILL get done this summer. I know I said that about April! I left the e-mail notification for your response to this thread in my in-box, so I won't forget about it!

I've attached the test program I wrote to this post. All it does is set the first process it finds that ends with ".scr" to the lowest priority. I know it works on 2000, so it should work on XP also, and I think it works on 98/ME. I realize this doesn't help much...

PrimeCruncher 2004-04-29 20:40

Okay, slight update:

Turns out the priority of a thread/process is actually a combination of two things: a priority 'class' and a priority 'value'. Prime95 is about the only application that uses the Low priority class. Unfortunately, if Prime95's priority is set to 1, this means that the screensaver still has higher priority because the screensaver has a priority value of 4.

As a result, I've changed the code so that instead of changing the priority class of the screensaver, it just kills the screensaver period. More cycles for Prime95! :banana:

Whether this will cause the monitor to come out of sleep, I don't know yet (we'll find out when I code in the timer), but I'd think not; all that's happening is a process is being killed.

PrimeCruncher 2004-04-30 18:55

Another update: I've worked in the code for the timers, but I've hit a snag with the KB/mouse hooks. In order to do a system hook (to catch all KB/mouse activity), you have to use a hooking procedure in a DLL. So I'm working out how to code a DLL now...

crash893 2004-05-01 17:54

i would like to mabey make a suggestion for another feature

is there a way to turn prime95 off while the computer is not idle

then have it kick in after it detects a lenth of idle and turn back off if it detects a break in idle?

PrimeCruncher 2004-05-01 18:22

I thought about that but such a feature really has no point. Prime95 is designed to pick up spare cycles, not interfere with normal applications. Therefore it's best to just leave it running all the time, picking up whatever cycles we can.

Danath 2004-05-02 11:26

[QUOTE]Whether this will cause the monitor to come out of sleep, I don't know yet (we'll find out when I code in the timer), but I'd think not; all that's happening is a process is being killed.[/QUOTE]

I've already tried it before. The screensaver creates a window, with the title "Screen Saver". When you terminate the screensaver's process, this window is closed, and this causes the monitor to exit the stand-by mode. That's why simply killing the screensaver is not a good way to minimize the screensaver's CPU usage.

The only way I see is lowering the screensaver's priority to minimum, and increasing the priority of Prime95 to some high value. I've encountered a problem here: Prime95 have 2 threads, and I don't know how to increase the priority of a thread, just of a process (increasing the priority of a process with more than 1 thread does nothing - the working thread continues to run at idle priority).

PrimeCruncher 2004-05-02 14:26

[QUOTE=Danath]I've already tried it before. The screensaver creates a window, with the title "Screen Saver". When you terminate the screensaver's process, this window is closed, and this causes the monitor to exit the stand-by mode. That's why simply killing the screensaver is not a good way to minimize the screensaver's CPU usage.

The only way I see is lowering the screensaver's priority to minimum, and increasing the priority of Prime95 to some high value. I've encountered a problem here: Prime95 have 2 threads, and I don't know how to increase the priority of a thread, just of a process (increasing the priority of a process with more than 1 thread does nothing - the working thread continues to run at idle priority).[/QUOTE]

In that case, we have two options:

1) I believe there is an API call you can use to send the monitor (or the computer) into a specific power state. After we terminate the screensaver process, we could use that to send the monitor back into 'sleep' mode.

2) The API calls used to get a list of running processes can also get a list of running threads. I have no idea what Prime95's threads would be called, however, which is why I haven't attempted to do this. Increasing the priority class of the Prime95 process should work though (though I realize you say it hasn't), based on this quote from MSDN:

[QUOTE]The SetPriorityClass function sets the priority class for the specified process. This value together with the priority value of each thread of the process determines each thread's base priority level.[/QUOTE]

This, however, creates another problem. We can make Prime95's priority higher, but what level do we set it to? If this was going to be running only on NT/2K/XP machines, we can set it to BELOW_NORMAL_PRIORITY_CLASS, but that level doesn't exist on 98/ME. I guess we can try setting it to normal priority class; if the threads still run at idle priority, then they should still have a lower priority than standard applications.


All times are UTC. The time now is 05:35.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.