How to know if multi threading is working

Post Reply
BoredStudent
Posts: 1
Joined: Fri Nov 22, 2019 3:10 pm

How to know if multi threading is working

Post by BoredStudent »

Hi,

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);
I know im atleast missing a task scheduler, tried creating one with

Code: Select all

	btSetTaskScheduler(btCreateDefaultTaskScheduler());
but performance seemed to be the same (or perhaps a bit worse).

What are the steps to implement multi threading and how do i know if it is working?
Post Reply