Network Command threading

Joel,

Have been looking at a few bugs (2817049 in particular) and seeing a few strange things.

What is your understanding of how Commands coming in over the network from other players are interleaved with local player actions?

B.

Thus spake “Brent Easton”:

I have zero understanding of how that works. I don’t even know where the
code is which handles it. My guess is that it’s in some really old code
of Rodney’s.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Ok, found it.

Basically, Commands coming from other clients are channeled through VASSAL.chat.CommandDecoder which decodes them and then executes them using SwingUtilities.invokeLater(). So I am guessing that’s ok?

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake “Brent Easton”:

The way these things are now, I can’t say for sure whether it’s ok. We’ve
recently had something where a call to invokeLater() was the problem, not
the solution.

The only way I can see to get threading issues sorted properly at this
point is to seperate all of the model code from the view code and to make
sure that the view is touched only by the EDT and the model is touched
only by a different thread (or group of threads). I’m going to do this
once I can get clear of my dissertation.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Sounds good. I’m trying to get all my big changes in by then, so I will basically be just testing and tweaking and can keep out of your way while you hack and slash.

B.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)