open-dis-java icon indicating copy to clipboard operation
open-dis-java copied to clipboard

DIS_DeadReckoning and concrete classes not thread safe

Open camejia opened this issue 8 years ago • 1 comments

Per comments on getUpdatedPositionOrientation(): "This function does not actually perform the computations, it only returns the current state of the entity. The entity state is updated by the specified DR algorithm within the DR class behind the scenes. Updates are created every 1/30 seconds."

It is possible for an observer to query the state while the behind the scenes updates are in progress, returning a partially updated inconsistent state. In my opinion it may not be worthwhile to update this code to make it thread safe; perhaps warning comments should be added regarding this potential issue.

I believe the underlying math that does the updates is correct (both in the DIS_DeadReckoning concrete classes and the unified DeadReckoner implementation) and the thread safety is only an issue when used as described in the quoted comment above.

camejia avatar May 18 '17 03:05 camejia

This is a helpful comment @camejia . I have marked the mentioned DR_ classes deprecated, and will leave this issue open as a reminder of the thread safe-ness concern until the classes are removed from the project.

leif81 avatar Nov 09 '22 02:11 leif81

The DIS_DeadReckoning class was deprecated in the 5.1 release. Anyone still using this class please try using the DIS_DeadReckoner class instead.

leif81 avatar May 03 '23 03:05 leif81