[concurrency-interest] question on concurrent HashMap

Joe Bowbeer joe.bowbeer at gmail.com
Fri Nov 3 02:17:36 EST 2006


On 11/2/06, David Holmes <dcholmes at optusnet.com.au> wrote:
>
> I think what Joe was suggesting was a "push" style approach whereby
> the timer task, after getting updates from the database, posts an event
> to the Swing event thread that then has each component update itself
> with the latest data from the map. That way there is no need for the UI
> updates to wait for fresh data.
>

Yes.

One way to implement this while still preserving the beneficial
separation of UI from data model would be to add support for listeners
to the manager.

Then the UI could register a special "relaying" listener that, when
notified, would schedule (i.e., invokeLater) the appropriate update
task on the event thread.

--Joe


More information about the Concurrency-interest mailing list