Can multiple (or the same) methods be running simultaneously on one instance? [on hold]

68
January 11, 2019, at 11:10 AM

I'm attempting to make a video game and am worried about working with my world object in multiple threads.

If I have a method "doAction(Action action)" and two threads are calling this method simultaneously on the same object, could they mess with each other? Is there anything I have to do like make a queue?

The method will update various entities of the game (depending on the action). Each entity's "fields" are already a ConcurrentHashMap, but I'm not sure if this is necessary.

Because of user interaction, besides the basic time step method which would place calls to doAction, there could also be other calls from entities in between time steps or maybe at the exact same time.

I don't want to leave it be and run into hard to debug problems later on. Note that my understanding of threads is limited, so correct me if I'm misunderstanding something.

READ ALSO
Equivalent of const(C++) in Java

Equivalent of const(C++) in Java

I was wondering if there was an equivalent to c++'s const in JavaI understand the final keyword, but unfortunately I cannot use that to declare a functions return value final

43
How to resolve java.lang.ClassNotFoundException: DocumentException

How to resolve java.lang.ClassNotFoundException: DocumentException

I am using Spring Boot with spring security application, i am getting below exception while starting the application

63
BCrypt updating the library and interations - would it break my login?

BCrypt updating the library and interations - would it break my login?

I’ve an old legacy application using Spring Security (31

72