Zay-es is multithreading security?

can i save data to es in game logic thread.
applyChange and read data in jme main update thread?

The “game logic thread” is the “jme main update thread”. They are one and the same.

no, i make a new thread run game logic

what es are you using? Zay-es for example is thread-safe

Then - again - for what seems like a continous cycle - you’re doing it wrong. You are on your own because you refuse to follow the rules. You make your own rules, you fix your own problems. I can’t iterate this enough. I have no idea why you are so stubborn.

i am make a Frame synchronization rts game! the game logic only run 10 time per second!and the jme main update run 60 time per s!

float time = 0;
float maxTime = 1.0f / 10.0f; // your desired update rate.

public void update(float tpf) {
    time += tpf;

    if (time < maxTime) {
        return;
    }

    // do something.

    time = 0;

}

It’s as simple as that. Now my update logic runs at whatever rate I want it to.

Zay-ES is thread safe. Game logic can update components. View can see them after applyChanges(). Everything is safe assuming the components follow the “data only” rules and are immutable.

2 Likes