QUOTE(anthony_yio @ Feb 3 2006, 11:55 AM)
Unless you keep on spawning threads which the thread itself running endlessly. You should teoritically won't run out of RAM or CPU processing.
THanks for ya reply, the main program will spawn only one thread which will do all the stuff. It will call the main function over and over again.
QUOTE(perror @ Feb 3 2006, 12:05 PM)
If it is unix based, and since you put a sleep time that long, which equates to about 13.x hours between runtimes, you are better off just putting the app into the crontab.
Although you should clarify yourself. Your statement
"I placed thread.sleep(50000000), so the program will stay idle for 500000000 milliseconds before the next thread will fire up ... "
is quite vague. Are you saying that you have your main program thread spawn off a new thread, then go to sleep. And when it wakes up, spawns another thread and then goes to sleep? Or do you mean that you have a thread that runs, then sleeps for that amount of time, then wakes up again to perform a certain task, and then go back to sleep?
Thx perror, I have tried to use crontab but the cron itself dies halfway, it stops running every now and then which is really painful, we don't know whats the cause ....
the thread is in an infinite loop i placed while(true){ thread codes in here } so this program will never ends. I did not place any System.exit at all except when the program encounters an exception. In that infinit loop, is the thread.sleep(5000000)
I am aiming for 5 minutes, have not do the calculation so

, thus although it is infinite, the thread will sleep for 5 minutes before calling the function again ...
please let me know whether it is a good idea to place this never ending story into the server
thanks
This post has been edited by Hou_JaI: Feb 4 2006, 07:53 PM