[ODE] Running ODE in a thread

Jon Watte (ODE) hplus-ode at mindcontrol.org
Tue Nov 22 00:03:57 MST 2005


ODE is not thread safe. If you only ever call ODE from that other 
thread, then it "might" be safe, but any problems you run into probably 
will be new, exciting, and up to you to debug :-)

Also, note that ODE can be very stack hungry, and a new thread may not 
get as much stack as the main thread. There are some defines you can 
turn on to use malloc() instead of alloca() to make this less of a problem.

Cheers,

			/ h+


Vrej Melkonian wrote:
> I tried running ODE in a separate thread (using
> _beginthread) but it crashed after a couple of seconds
> into the simulation.
> 
> I'm using ODE 0.5, compiled as a DLL, VC++6,
> multithreaded DLL, debug version
> 
> ode\src\step.cpp, 
> 
> //****************************************************************************
> // an optimized version of dInternalStepIsland1()
> 
> void dInternalStepIsland_x2 (dxWorld *world, dxBody *
> const *body, int nb,
> 			     dxJoint * const *_joint, int nj, dReal
> stepsize)
> 
> 
> At the line
> 
> // no feedback is required, let's compute cforce the
> faster way
> MultiplyAdd1_8q1 (cforce + 8*b1->tag,JJ,
> lambda+ofs[i], info[i].m);
> 
> where b1 is 0x00000000
> 
> Any ideas?
> 
> 
> 		
> __________________________________ 
> Yahoo! FareChase: Search multiple travel sites in one click.
> http://farechase.yahoo.com
> _______________________________________________
> ODE mailing list
> ODE at q12.org
> http://q12.org/mailman/listinfo/ode
> 
> 


More information about the ODE mailing list