I've been trying to turn my single threaded project into multi threaded.
Currently all i've done is this code when i create the world (SolverMt causes a crash when i use it so i use solver instead).
Code: Select all
Physics::Physics() :broadphase(new btDbvtBroadphase())
{
collisionConfig = new btDefaultCollisionConfiguration();
dispatcherMt = new btCollisionDispatcherMt(collisionConfig, 40);
btConstraintSolver* solvers[BT_MAX_THREAD_COUNT];
int maxThreadCount = BT_MAX_THREAD_COUNT;
btConstraintSolverPoolMt* solverPool = new btConstraintSolverPoolMt(maxThreadCount);
btSequentialImpulseConstraintSolverMt* solverMt = new btSequentialImpulseConstraintSolverMt();
btSequentialImpulseConstraintSolver* solver = new btSequentialImpulseConstraintSolver();
world = new btDiscreteDynamicsWorldMt(dispatcherMt, broadphase, solverPool, solver, collisionConfig);
Code: Select all
btSetTaskScheduler(btCreateDefaultTaskScheduler());
What are the steps to implement multi threading and how do i know if it is working?