A
adrian.bartholomew
ok. let me try an easier explanation.
online card game for 4.
my main program on the server side is runnable. it is also an animated
gui of the game showing all 4 hands.
i have an endless loop as my run() method.
it consists of many if statements that each call various animation
methods that exist outside this run() method.
whenever an animation is needed, another thread turns one of these
flags "true".
the run() method then goes into that particular animation method. the
1st line of code of the animation immediately switches the flag back
to "false" to prevent false re-entry.
is there another way to do this animation?
the resources of the server computer would be bogged down if each
instance of the game ran an endless loop no?
more importantly, i need each animation method to be atomized but when
i synchronize them, the other thread that carries out client requests
goes into deadlock.
if i have to, how do i use wait() notifyAll() in this situation?
online card game for 4.
my main program on the server side is runnable. it is also an animated
gui of the game showing all 4 hands.
i have an endless loop as my run() method.
it consists of many if statements that each call various animation
methods that exist outside this run() method.
whenever an animation is needed, another thread turns one of these
flags "true".
the run() method then goes into that particular animation method. the
1st line of code of the animation immediately switches the flag back
to "false" to prevent false re-entry.
is there another way to do this animation?
the resources of the server computer would be bogged down if each
instance of the game ran an endless loop no?
more importantly, i need each animation method to be atomized but when
i synchronize them, the other thread that carries out client requests
goes into deadlock.
if i have to, how do i use wait() notifyAll() in this situation?