Issue 28 in opentestbed: JFreeChart not thread safe

43 views
Skip to first unread message

opent...@googlecode.com

unread,
Nov 4, 2010, 12:50:15 PM11/4/10
to opent...@googlegroups.com
Status: Accepted
Owner: guy...@gmail.com
Labels: Type-Defect Priority-Medium

New issue 28 by guy...@gmail.com: JFreeChart not thread safe
http://code.google.com/p/opentestbed/issues/detail?id=28

I believe the creation of the JFreeChart GUI and all modifications to it
should go through
SwingUtilities.invokeLater(...)
to make it threadsafe.
Right now the main thread makes these updates.


opent...@googlecode.com

unread,
Nov 13, 2010, 4:35:16 PM11/13/10
to opent...@googlegroups.com

Comment #1 on issue 28 by bluegaspode: JFreeChart not thread safe
http://code.google.com/p/opentestbed/issues/detail?id=28

All updates should be done in the SwingThread already as a
javax.swing.Timer is used for the updates.
One could discuss whether building the initial frame should be done on the
UIThread as well, but as far as I know it is allowed to create a GUI on a
foreign thread as long as its not made visible.

One could also discuss the upateBankroll method, as read-access on
currentGamesPlayed + currentSeatPermutation is not synchronized (but they
are volatile), but I thought noone would care if on the GUI both values are
one off compared to the graph.

Changes/Read-Access to the 'stats' variable is synchronized though.


So from my point of view we have no threading problems.


Reply all
Reply to author
Forward
0 new messages