winboard doesn't have a way to lower the engine priority, and I go nuts!
Ok let's ask H.G. Muller politely. He occasionally reads this forum
Well, it sounds easy enough, if someone would tell me the required Windows API call. Or is Cygwin gcc smart enough to understand the nice() system call even with -mno-cygwin compiles?
I guess supplying this option for engines independently would only invite cheating. So I could add a single command-line option -niceEngines N.
"child" is the HANDLE of the engine. It is a (static) global variable set at creation
of the engine process.
Ugh. It never occurred to me that code might be used elsewhere or I would have commented things better. Be aware:
The SetPriorityClass() API call (And the creation flags in the CreateProcess() call) do not understand ABOVE_NORMAL_PRIORITY_CLASS or BELOW_NORMAL_PRIORITY_CLASS below windows 2000. (I think.. who knows, this stuff changes every windows version) So if you want to lower the priority on Windows 9x, the above code won't work unless your EngineNice option is 15 or greater. One of the older compilers I tested didn't have those flags in its headers, which is why I didn't use the identifiers.
OK, I put it in, and it seems to work. Just run WinBoard with the command-line option
-niceEngines N
and the engines will run at the altered priority. Default is N=0 (normal priority = the same as the GUI process). Wit N=10 or N=20 you can lower the priority to "below normal" or "low", respectively. I checked that this works with the task manager.
The option setting is saved in the winboard.ini, as I suppose that you would set it once and for all to get a smooth operation on and of your system.
With N=-10 or -20 you could raise the priority, I suppose, but this is not recommended.
The alpha.tst on my website is the winboard.exe that contains the change.
OK, so that is a good new feature to include in WinBoard 4.3.16 then! I already put the option in xboard.c as well (simply calling nice() with the given option value within the child process, just before exec()), but I haven't tested it yet.
Michel wrote:Now that I have done a lot of restructuring of the Windows code it appears that the native port of PG is based on a class called "PipeStruct."
Who is the author of that class? Is it Fonzy Bleumers?
I did some Googling. I found some chinese websites but the license of the code is unfortunately in Chinese....
I just would like to make sure the license is GPL compatible.
Original windows port was by Fabien himself (just before WCCC 2005) for the preparation of Fruit's tournament opening book.
It could well be that fabien himself was the author of this ?
Original windows port was by Fabien himself (just before WCCC 2005) for the preparation of Fruit's tournament opening book.
It could well be that fabien himself was the author of this ?
That would be very nice. Can someone confirm this?
PG always ran on Windows but you needed the Cygwin dll. The current version
of PG uses the native WIN32 api.
Original windows port was by Fabien himself (just before WCCC 2005) for the preparation of Fruit's tournament opening book.
It could well be that fabien himself was the author of this ?
That would be very nice. Can someone confirm this?
PG always ran on Windows but you needed the Cygwin dll. The current version
of PG uses the native WIN32 api.