Difference between revisions of "Thread safety"

From JPCT
Jump to: navigation, search
(Created page with '=== 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...…')
 
(Thread safety)
 
Line 3: Line 3:
 
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).
 
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.
+
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 or use some event queue that will be processed in the rendering thread.

Latest revision as of 14:06, 2 March 2015

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 or use some event queue that will be processed in the rendering thread.