[android-developers] Re: insidious multi-threading bug

2013-04-24 Thread bob
I think I'm going to use this method in GLSurfaceView: */*** * * Queue a runnable to be run on the GL rendering thread. This can be used* * * to communicate with the Renderer on the rendering thread.* * * Must not be called before a renderer has been set.* * * @param r the run

[android-developers] Re: insidious multi-threading bug

2013-04-24 Thread RichardC
Put the input events into your own internal queue. Process the your event queue in your update-AI/update-user-event phase of your game logic. The queue should be locked when adding/removing events. On Wednesday, April 24, 2013 4:26:02 PM UTC+1, bob wrote: > > I've been investigating an insidious

[android-developers] Re: insidious multi-threading bug

2013-04-24 Thread Piren
Either synchronize things to prevent this (either synchronizing the list or the clearing with drawing), or use a list that is concurrent (http://developer.android.com/reference/java/util/concurrent/package-summary.html) or add an event to run the clearing of the list on the same thread that h