Advertisement

Checking CPU/RAM useage?

Started by November 11, 2000 04:20 PM
0 comments, last by delor 24 years, 1 month ago
Long story short, I'm trying to work on a multiplayer game that is persistant over a time span of a month or so (then the game ends and another begins), and I'm wondering if there's any reasonably simple (and non-resource intensive) way of measuring CPU and RAM useage within the program. I only have one machine, so unless I can find someone else with constant internet access and a spare machine, that means my machine is the server. What I want the server to do is save the game status every 15 minutes or so, but every 4 minutes or so check how much of a load my machine is under, and if it can do it without lagging down the game for everyone playing, update the backup then as well. (ie. if there are many players using it, or I'm running another resource-intensive program in the background, it'll choose not to update the backup so as to avoid lagging everyone playing) ======================= Happiness is mandatory. Edited by - delor on 11/11/00 4:21:38 PM
=======================Happiness is mandatory.
This totally depends on what operating system you are developing the server for. The system calls are different for each OS.

However, I would recommend an idle thread that sleeps alot. This way, the operating system will only allow a save if and only if nothing else is going on. After all, you don''t want to save at the 15 minute mark if there was nothing going on at the 14 minute mark.

Stay alert.
Trust no one.
Keep your laser handy.

This topic is closed to new replies.

Advertisement