Iterators over a LInked List in a Game in Java

Posted by Matthew on Stack Overflow See other posts from Stack Overflow or by Matthew
Published on 2012-11-23T04:57:49Z Indexed on 2012/11/23 4:59 UTC
Read the original article Hit count: 103

I am using OpenGl in android and they have a callback method called draw that gets called with out my control. (As fast as the device can handle if I am not mistaken) I have a list of "GameObjects" that have a .draw method and a .update method. I have two different threads that handle each of those. So, the question is, can I declare two different iterators in two different methods in two different threads that iterate over the same Linked List? If so, do I simply declare ListIterator<GameObject> l = objets.listIterator() each time I want a new iterator and it won't interfere with other iterators?

© Stack Overflow or respective owner

Related posts about java

Related posts about multithreading