Thread safety

From JPCT
Revision as of 09:46, 5 April 2013 by Admin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Thread safety

jPCT as well as jPCT-AE aren't thread safe. This means that you are not supposed to manipulate jPCT related instances (like instances of World, Object3D...) from outside the render thread/method once the rendering has been started (setup work can be done in any thread of cause).

Be careful with your mouse/key/touch event listeners and don't let them access jPCT instances directly, because they usually don't execute in the same thread as the rendering does. It's good practice to let the event handler methods just set some flags and evaluate them in the render thread.