mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Software

Reply
 
Thread Tools
Old 2004-02-03, 18:10   #45
crash893
 
crash893's Avatar
 
Sep 2002

23·37 Posts
Default

Quote:
Originally Posted by 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.

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 is offline   Reply With Quote
Old 2004-03-01, 00:19   #46
crash893
 
crash893's Avatar
 
Sep 2002

23×37 Posts
Default

bump
crash893 is offline   Reply With Quote
Old 2004-03-01, 00:34   #47
PrimeCruncher
 
PrimeCruncher's Avatar
 
Sep 2003
Borg HQ, Delta Quadrant

2×33×13 Posts
Default

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!
PrimeCruncher is offline   Reply With Quote
Old 2004-04-27, 17:47   #48
crash893
 
crash893's Avatar
 
Sep 2002

4508 Posts
Default

hey

so just checking up

whats the word
crash893 is offline   Reply With Quote
Old 2004-04-27, 18:57   #49
PrimeCruncher
 
PrimeCruncher's Avatar
 
Sep 2003
Borg HQ, Delta Quadrant

2·33·13 Posts
Default

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...
Attached Files
File Type: zip minimum.zip (875 Bytes, 101 views)
PrimeCruncher is offline   Reply With Quote
Old 2004-04-29, 20:40   #50
PrimeCruncher
 
PrimeCruncher's Avatar
 
Sep 2003
Borg HQ, Delta Quadrant

12768 Posts
Default

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!

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 is offline   Reply With Quote
Old 2004-04-30, 18:55   #51
PrimeCruncher
 
PrimeCruncher's Avatar
 
Sep 2003
Borg HQ, Delta Quadrant

12768 Posts
Default

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...
PrimeCruncher is offline   Reply With Quote
Old 2004-05-01, 17:54   #52
crash893
 
crash893's Avatar
 
Sep 2002

12816 Posts
Default

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?
crash893 is offline   Reply With Quote
Old 2004-05-01, 18:22   #53
PrimeCruncher
 
PrimeCruncher's Avatar
 
Sep 2003
Borg HQ, Delta Quadrant

2·33·13 Posts
Default

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.
PrimeCruncher is offline   Reply With Quote
Old 2004-05-02, 11:26   #54
Danath
 
Danath's Avatar
 
May 2003
Republic of Moldova

2816 Posts
Default

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.
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).
Danath is offline   Reply With Quote
Old 2004-05-02, 14:26   #55
PrimeCruncher
 
PrimeCruncher's Avatar
 
Sep 2003
Borg HQ, Delta Quadrant

2·33·13 Posts
Default

Quote:
Originally Posted by 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).
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.
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.
PrimeCruncher is offline   Reply With Quote
Reply

Thread Tools


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


Fri Aug 6 05:35:59 UTC 2021 up 14 days, 4 mins, 1 user, load averages: 3.91, 3.25, 2.85

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

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.