Bug#866378: 3dchess: 100 % CPU consumption
Markus Koschany
apo at debian.org
Thu Jun 29 22:09:23 UTC 2017
Am 29.06.2017 um 21:24 schrieb Fabian Greffrath:
> control: tags -1 +patch
>
> Am Donnerstag, den 29.06.2017, 12:04 +0100 schrieb James Cowgill:
>> It looks to me like the game loop has no sleeps or other waiting in
>> it.
>> It has probably always consumed 100% CPU.
>
> Good catch! I have simply added a usleep(10) call in the main loop,
> effectively capping the game at about 100 FPS, and it settled at around
> 4% CPU consumption:
>
> --- 3dchess-0.8.1.orig/src/main.c
> +++ 3dchess-0.8.1/src/main.c
> @@ -201,6 +201,7 @@ DoMain3DcLoop(void)
> XtDispatchEvent(&event);
> }
>
> + usleep(10);
> } /* End game loop */
>
> return;
Well done! I need to finish some stuff here and test your patch soon.
Cheers,
Markus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-games-devel/attachments/20170630/b149988a/attachment.sig>
More information about the Pkg-games-devel
mailing list