Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COThe problem is not the state change issued by the SwingWorker, but the potential overlapping of user action and the evaluations running in the SwingWorker. For example, the worker thread wants to compute the total energy demand and energy production of the player's buildings on the player's planets and then assign energy to various buildings based on some criteria. But when this aggregation runs, the user might issue commands in EDT to add or remove buildings on a planet. If the state model is shared, this leads to concurrency problems. I'm looking for methods to avoid this.
      singulars
    2. COYou will need to synchronize the aggregation and the changes, either by using a lock (possibly a ReadWriteLock) or by putting all the code in a single thread (although then it would have to be a thread other than the EDT).
      singulars
    3. COApproximately 75% of the game model is used for rendering or read only. The dynamic part is written in EDT and read in EDT/worker threads. Writes never overlap but reads/writes might. If the model is not in the EDT, rendering slows down due increased number of cross-boundary query/lock contention. I'm thinking about taking a snapshot of the 25% into a sub model and use that as a read-only basis for the computations. Some of the computation/aggregation is currently performed in EDT on each rendering pass but these have to be moved elsewhere anyway.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload