I've fixed #2480 by replacing LinkedList with ConcurrentLinkedQueue (or at least I hope so, I don't have gps device with me to test it).
Just a few thoughs about threading issues... Making data structures thread safe does not necessary mean big synchronization overhead. For example ConcurrentLinkedQueue is about as fast as simple LinkedList (and a bit slower than ArrayList). WayPoint class can be made immutable which would make it also thread safe without any performance impact. In JOSM two threads can modify osm data - EDT and worker thread. That's usually ok (because when worker thread is doing some work then PleaseWait dialog is shown blocking EDT) but it's not perfect, we have some tickets about problems caused by concurrent access. It would be nice to have all osm data thread safe but it's a bigger change and I'm not sure about performace issues. SwingWorker is a nice class, but we already have PleaseWaitRunnable that can do similar things. Swing should not be accessed in other than EDT thread but it's not true that Swing is not sychronized at all. JTextField.setText is one example of thread safe method. -- Jiri _______________________________________________ josm-dev mailing list [email protected] http://lists.openstreetmap.org/listinfo/josm-dev
