i've never done any multithreading stuff in java before. for a while, i was getting some IllegalThreadStateExceptions and stuff was acting weird. so i set my timer thread up as a daemon thread.
what i've been wondering is, though, since our players will be running in their own processes, and the process will terminate itself or be killed automatically after a time limit, is there any dangers i should be aware of in terms of causing thread-related exceptions?
i'm not really sure how to cleanly kill a thread without just letting it die. normally i'd just do something that appeared to work, but i don't want to risk the program crashing in the tournament. so, my timer thread just executes for 5 seconds no matter what, even if the ai gets a move out before then (which sometimes happens in certain cases). when our player's process gets killed, will there be any potential problems having to do with threads that are still running?
thanks,
jason
|