My program has an openGL rendering thread and a data modification thread. The rendering thread accesses the data in a gaggle of ArrayLists, while the data modification thread alters, removes, and adds objects to the ArrayLists. The threads update about 60 times per second, and the ArrayList manipuation is the program's bottleneck. I've tried synch blocks (super slow), CopyOnWriteArrayLists (quite slow), and creating buffer ArrayLists in the rendering thread (lesser of three evils). What's the 'best' way to get maximum efficiency out of concurrent ArrayLists?
List<YourObject> syncList = Collections.synchronizedList(yourList);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With