← Thread:Talk:RoboRumble/ThreadDeath problem/reply (2)
You do not have permission to edit this page, for the following reasons:
- The action you have requested is limited to users in the group: Users.
- You must confirm your email address before editing pages. Please set and validate your email address through your user preferences.
You can view and copy the source of this page.Rsalesc (talk)
Ok. Roborio also fall into ThreadDeath in the battle:
rsalesc.roborio.Roborio 1.2.7 vs penguin.Joker .611wr
It does not happens at 1000 FPS, only if I push the slider to max.
I also see DrussGT falling into ThreadDeath in the battle:
jk.mega.DrussGT 3.2.1 vs penguin.Joker .611wr
It seems that in a pair of bots the most CPU demanding gets the exception.
I looked at the internals. The difference between desired 1000 TPS and max is that in the later case the Thread.sleep is called (actually if you have more than 0.5 ms to spare). I am guessing that probabilistically Thread.Sleep is called couple times per round.
I do not know what java does when thread is asleep, but I would imagine that the garbage collector and other gizmos kick in during the sleep. While at max TPS the java chooses as it wishes when to run GC and if you are the unlucky one, the GC time will be counted against your bot. This would explain sporadic super long executions in my bot time profiling.