[android-developers] Re: Handling asynchronous events and blocking

2011-10-24 Thread Peter Webb
I can certainly create (say) a LinkedList of events which acts a queue of instructions for my main loop. My issue is that after processing an event, I have to remove it from the queue. According to http://download.oracle.com/javase/1.4.2/docs/api/java/util/LinkedList.html : Note that this

Re: [android-developers] Re: Handling asynchronous events and blocking

2011-10-24 Thread TreKing
On Mon, Oct 24, 2011 at 1:20 AM, Peter Webb r.peter.w...@gmail.com wrote: This must be a very common problem, and I would expect a simple standard solution. As I mentioned, on other platforms I have used a guaranteed atomic process (file creation)as a semaphore for synchronisation, but I doubt

[android-developers] Re: Handling asynchronous events and blocking

2011-10-24 Thread Peter Webb
ConcurrentLinkedQueue. Exactly what I want. Thankyou. On Oct 24, 11:16 pm, TreKing treking...@gmail.com wrote: On Mon, Oct 24, 2011 at 1:20 AM, Peter Webb r.peter.w...@gmail.com wrote: This must be a very common problem, and I would expect a simple standard solution. As I mentioned, on other

Re: [android-developers] Re: Handling asynchronous events and blocking

2011-10-24 Thread Studio LFP
Nice, I'll have to play with that too. I never ran into any exceptions because I use touches very little in the game I am playing around with. Steven Studio LFP http://www.studio-lfp.com On Monday, October 24, 2011 7:16:47 AM UTC-5, TreKing wrote: On Mon, Oct 24, 2011 at 1:20 AM, Peter Webb

[android-developers] Re: Handling asynchronous events and blocking

2011-10-23 Thread Studio LFP
I figure you are running a thread that does all the processing as not to block the UI thread. If so, one of the ways I've been doing it is to add something like... public static LinkedListMotionEvent uiEvents; ... to a helper object and then check the length of it every time through the