ewjordan wrote:
- Is your app multi-threaded by any chance? I'm wondering if maybe the UI thread is altering some of the data concurrent with the simulation or something like that. None of this is thread safe, so that could definitely cause some problems.
That statement gives me some headaches because my application is multi-threaded. As a result it freezes from time to time since I have assertions enabled. I think there are three alternatives:
- 1) Change my way of calling JBox2D methods (not that easy because of multi-threaded 3rd party code)
2) Turn off assertions and pray
3) Tune the JBox2D code in that way, that whenever the "m_lock" field is accessed instead of an assertion some synchronization code is executed
From looking into the code it looks like option number 2 will hardly work because vital methods will exit before doing stuff.
Do you think alternative number 3 is worth a shot? Probably with some classes of the concurrency package (http://java.sun.com/docs/books/tutorial ... level.html) it's possible to let multiple threads call methods of the world object without exceptions and methods guaranteed to be executed. Hm ❓
Stefan
btw: This thread is becoming a little too long to find information. Would an own JBox2D forum be a good idea?