[K12OSN] GNUChess

Petre Scheie petre at maltzen.net
Thu Apr 14 13:02:45 UTC 2005


This might be a good case to try building an application server dedicated to GNUchess. 
If GNUchess will run acceptably on a lesser box, and you have an old spare one to use 
for this, it could be a good experiment. Even if it fails, the impact would be 
insignificant (as opposed to trying this w/OOo which everyone depends on).  And when it 
sucks up all the CPU cycles, who cares, as those cycles aren't used for anything else.

Petre

Martin Woolley wrote:
> On Thursday 14 April 2005 03:15, Sudev Barar wrote:
> 
>>On Wed, 2005-04-13 at 20:24 +0200, M.Pribik wrote:
>>
>>>I have the same experience with cca 100% utilisation of CPU by GNUchess.
>>>I have 3GHz hyperthreading P4.
>>>CPU1 and CPU2 cyclicly alternates between cca. zero and cca. 100%.
>>>Marian.
>>
>>[SNIP]
>>
>>See my message sometimes last summers. The only way to protect your LTSP
>>setup is to remove the program as by default it sucks up as much
>>resources as available to do its computation. Alternatively you have to
>>run it with higher nice level. Maybe some guru can point HOWTO.
> 
> 
> On our system, the kde menus run the command xboard.  The binary for gnuchess 
> is /usr/bin/xboard.  I wrote the following wrapper /usr/local/bin/xboard 
> which informs the user that they can only play chess after school and when 
> they do so, the command is executed at the lowest priority.  Even at the 
> lowest priority it still hogs the cpu, but we don't care after hours.  You 
> must have the Perl/TK libraries installed for this script to work.
> 
> -- cut here --
> 
> #!/usr/bin/perl
> #-----------------------------------------------------------------------#
> # @(#) xboard v1.00 - 14/01/05 (c) 2005 Handsworth Grammar School       #
> # Author: Martin Woolley (Handsworth Grammar School)                    #
> # Written: 14/01/05                                                     #
> # Reason: This is a wrapper for /usr/bin/xboard (gnuchess).             #
> #         gnuchess is a cpu hog and while we could just remove it, we   #
> #         are not completly heartless, so we will allow them to run     #
> #         the program after 15:00 hours.                                #
> #-----------------------------------------------------------------------#
> 
> use Tk;
> 
> ($SEC,$MIN,$HOUR,$DAY,$MONTH,$YEAR,$WEEKDAY,$DAYOFYEAR,$DST)=localtime(time);
> if ($HOUR < 15) {
> 
> my $mw = MainWindow->new;
> $mw->title("Handsworth Grammar School");
> 
> $message = "You may only play chess after 3:00pm. We apologise for any 
> inconvienience caused." ;
> $mw->Message(-text => $message)->pack;
> 
> $mw->Button(-text => "OK", -command =>
>  sub { $mw->destroy() } )
>  ->pack(-side=>'left', -expand=> 1, -fill => 'x');
> 
> MainLoop;
> 
> }
> else {
> $CMD="/bin/nice -n 19 /usr/bin/xboard";
> $RC=exec($CMD);
> }
> 
> exit 0;
> -- end cut --




More information about the K12OSN mailing list