Search found 99 matches

by lunkhound
Wed Dec 24, 2014 6:38 pm
Forum: General Bullet Physics Support and Feedback
Topic: CPU multithreading is working!
Replies: 145
Views: 85544

Re: CPU multithreading is working!

Glad to hear that fixed it for you! With only 10-12 bodies, and likely very few contacts and constraints there just isn't that much work to make it worth splitting up into separate tasks. The island manager will merge islands that have less than 32 bodies to keep the number of islands manageable whe...
by lunkhound
Wed Dec 24, 2014 8:45 am
Forum: General Bullet Physics Support and Feedback
Topic: CPU multithreading is working!
Replies: 145
Views: 85544

Re: CPU multithreading is working!

I was able to replicate the issue. There were some un-threadsafe things going on with the GImpactMeshShapePart class. Specifically the lockChildShapes and unlockChildShapes methods were being called from multiple threads on the same object in the narrowphase. I pushed a change that leaves the origin...
by lunkhound
Tue Dec 23, 2014 7:51 pm
Forum: General Bullet Physics Support and Feedback
Topic: CPU multithreading is working!
Replies: 145
Views: 85544

Re: CPU multithreading is working!

I haven't used the GImpact shapes before. I'll take a look and report back.
by lunkhound
Tue Dec 23, 2014 7:35 pm
Forum: General Bullet Physics Support and Feedback
Topic: Substeps and performance: game logic in tick callback.
Replies: 4
Views: 3060

Re: Substeps and performance: game logic in tick callback.

The spiral of death. Kind of a big problem with the fixed-size time steps approach.

I've used variable time steps to avoid this on past projects. You can't let the steps get too big though, or things tend to blow up.
by lunkhound
Tue Dec 23, 2014 12:53 am
Forum: General Bullet Physics Support and Feedback
Topic: CPU multithreading is working!
Replies: 145
Views: 85544

Re: CPU multithreading is working!

EDIT: This is working great any chance this would get merged back into the main trunk I'm planning to make a pull request soon. I'm just waiting to see if any bugs crop up and hopefully get a few more reports from people using it. I'm still very interested in hearing about how it works on various p...
by lunkhound
Thu Dec 18, 2014 5:21 pm
Forum: General Bullet Physics Support and Feedback
Topic: CPU multithreading is working!
Replies: 145
Views: 85544

Re: CPU multithreading is working!

:D ! Just to say I'm very happy I can use callbacks and the OpenMP version! Only one additional thing: On Linux 64bit in LinearMath/btThreads.cpp , I had to change: bool btIsAligned( const void* ptr, unsigned int alignment ) { btAssert( ( alignment & ( alignment - 1 ) ) == 0 ); // alignment should ...
by lunkhound
Thu Dec 18, 2014 6:12 am
Forum: General Bullet Physics Support and Feedback
Topic: CPU multithreading is working!
Replies: 145
Views: 85544

Re: CPU multithreading is working!

It turns out both TBB and OpenMP have similar functions to query the number of hardware threads. For OpenMP its: omp_get_max_threads(); and for TBB its: tbb::task_scheduler_init::default_num_threads(); So I removed the hardcoding to 4 threads. My machine is a 4-core with hyperthreading, so both of t...
by lunkhound
Thu Dec 18, 2014 12:06 am
Forum: General Bullet Physics Support and Feedback
Topic: CPU multithreading is working!
Replies: 145
Views: 85544

Re: CPU multithreading is working!

Alright, now you can choose between TBB and OpenMP. TBB is the default. To switch to OpenMP, open up MultiThreadedDemo.cpp and set USE_TBB to 0 and USE_OPENMP to 1. Then make sure your compiler options are set to OpenMP mode. Performance between the two seems about the same on my machine. Oh, I noti...
by lunkhound
Wed Dec 17, 2014 8:44 pm
Forum: General Bullet Physics Support and Feedback
Topic: CPU multithreading is working!
Replies: 145
Views: 85544

Re: CPU multithreading is working!

I don't usually like to pop-in and interrupt an ongoing discussion: however I'd like to make a few brief questions/considerations, soon after having thanked lunkhound for having restored/rewritten/reconsidered/reforked the Bullet Multithreaded branch :) . Here are my questions/considerations (I sti...
by lunkhound
Wed Dec 17, 2014 4:32 am
Forum: General Bullet Physics Support and Feedback
Topic: CPU multithreading is working!
Replies: 145
Views: 85544

Re: CPU multithreading is working!

The threadsafe version of Bullet relies mainly on C++11 atomics for thread synchronization. This should be widely available on all modern platforms (including iOS devices). If it doesn't work out of the box on iOS it should just be a trivial change to make the detection of atomics support more robus...
by lunkhound
Tue Dec 16, 2014 7:39 am
Forum: General Bullet Physics Support and Feedback
Topic: CPU multithreading is working!
Replies: 145
Views: 85544

Re: CPU multithreading is working!

Latest changes in my repo: The DbvtBroadphase rayTest is now threadsafe. Changed the island batching/merging to improve performance and reduce memory usage. 3 methods of the DiscreteDynamicsWorld now run in parallel for the MultiThreadedDemo: predictUnconstraintMotion, createPredictiveContacts, and ...
by lunkhound
Sun Dec 14, 2014 8:53 am
Forum: General Bullet Physics Support and Feedback
Topic: CPU multithreading is working!
Replies: 145
Views: 85544

Re: CPU multithreading is working!

It does run on android arm. tbb was a monster pain until I found that opencv builds it using CMake, so I hijacked that. As to performance, I have no idea. I'll need to take a bit of time, do some instrumenting for systrace and set up a test similar to the demo. When I get around to that I'll be sur...
by lunkhound
Sat Dec 13, 2014 7:13 pm
Forum: General Bullet Physics Support and Feedback
Topic: CPU multithreading is working!
Replies: 145
Views: 85544

Re: Why was BulletMultiThreaded thrown out?

@c6burns: Thanks for your work on that! I've merged your changes. The CMake process is much smoother now. I should fix up the instructions I wrote up earlier. I'll fix the non-threaded debug build issue you found in just a bit [EDIT: fixed!]. I'm eager to hear if it runs on ARM hardware. Revised Ins...
by lunkhound
Fri Dec 12, 2014 10:24 pm
Forum: General Bullet Physics Support and Feedback
Topic: CPU multithreading is working!
Replies: 145
Views: 85544

Re: Why was BulletMultiThreaded thrown out?

To give a better picture of how the multi-threading works, here are a couple of screen captures from my own application which supports profiling on multiple cores. The horizontal axis is time (with vertical white lines marking off 1 millisecond intervals). The vertical axis is call-depth, and each c...