|GlazedListsEventLayer: multi-threading issue [message #1101454]
||Wed, 04 September 2013 13:27
| Steve Kramer
Registered: January 2013
I've come across an issue with NatTable 1.0.1 when the underlying EventList of a NatTable is updated asynchronously via a separate thread. Effectively, the NatTable doesn't seem to refresh reliably when adding multiple elements to the underlying eventList using the addAll() method. Adding a few hundred rows seems to work fine in my environment (OSX 10.7) but adding half a million rows at a time fails and the table appears empty after the update.
Looking into the details of the GlazedListsEventLayer.fireEventFromSWTDisplayThread() method I noticed that it doesn't lock the underlying eventList before firing the event to the layer stack. This allows for a race condition as the event is allowed to propagate up the layer stack before the appropriate eventList is being unlocked by the updating thread.
What is the specific reason for not locking the eventList before firing the event to the layer stack ?
The issue I described above can be reliably reproduced with a slightly modified version of the _200_Group_by example from the NatTable 1.0.1 distribution. I can email the file to anybody interested in more details. The same issue revealed another bug in the ViewportEventHandler.handleLayerEvent() method where the case handing vertical structure changes is using scrollableLayer.getColumnCount() instead of scollableLayer.getRowCount() on line 76.
Powered by FUDForum
. Page generated in 0.05731 seconds