I'm trying to wrap my brain around how to get my collision resolution to work with multiple threads.

I'v read through the source code of Box2D and while quite challenging and educating, not something to really point me to how I could use multiple threads.

I'm ready to make some sacrifices with accuracy, I just need to be able to use multiple threads, since I have boatloads of objects in the game.

My current implementation handles AABB checks for 100000 objects in about 10 ms. I have no idea if this number is good, but for my purposes it seems sufficient.

What I'm trying to figure out next is how to resolve collisions.

What would be a good way to get power out of multiple threads here?

This is what i'm currently planning to do: (Do you see any issues with it?)

 1. Calculate position for each object in separate threads based on manifold data
 2. Update existing manifolds in separate threads
 3. get New collisions for moved objects in separate threads
 4. Repeat 10 times or until no changes