HI
I need to create server for one game. But for seerver limits iI must use php instead java. I started yesterday with learning and I dont know if and how this could be done in php: Server must be running everytime from time he is deployed on server to shutdown. He must check game state and be performing nescessary actions every 1/10 of second. Like this in java language:
public void run()
{
while(isALive)
{
//prikazy...
Thread.sleep(100);
}
}
How is it with running this infinity script on server? Are with this any problems??
Thanks for answers
action repeating
Moderator: General Moderators
action repeating
Last edited by kavaja on Fri Feb 11, 2005 3:15 am, edited 1 time in total.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
for one, an infinitely running loop will typically eat the processor on the server, although at .1 second loops, it's less of a problem than most.. but, depending on number of actions needed, that can be using a lot of system resources.
the major thing to do is run it from the command line, or via cron.. using a mutex/semaphore locking mechanism to keep from running concurrently.. You'll have to set the script to have an infinite time limit as well.
the major thing to do is run it from the command line, or via cron.. using a mutex/semaphore locking mechanism to keep from running concurrently.. You'll have to set the script to have an infinite time limit as well.