MultiThreadDemo

Post Reply
User avatar
sio2interactive
Posts: 31
Joined: Tue Jul 29, 2008 10:26 am
Contact:

MultiThreadDemo

Post by sio2interactive »

Im trying to implement Bullet in another thread within my application, so I compile (with Jam) the MultiThreadDemo, everything compiles fine but when I run I get the following error, am I missing something:

PThread problem at line 106 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
PThread problem at line 132 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1

The demo is running but all the objects are simply falling down thought the floor... and the error message above is displayed non stop on the console.

Im on MacOS X 10.5.5 with XCode 3.1

Is it just me or some else meet the same problem, and if yes how to fix it.

Tks in advance,

Cheers,
Enrico
Posts: 42
Joined: Thu May 17, 2007 9:34 am
Location: Stuttgart, Germany
Contact:

Re: MultiThreadDemo

Post by Enrico »

Hi,

when you start the demo there are messages like

starting thread 0


thread 0 started
Please post the messages directly after the start, so I can see if there is some problem with thread creation :)
User avatar
sio2interactive
Posts: 31
Joined: Tue Jul 29, 2008 10:26 am
Contact:

Re: MultiThreadDemo

Post by sio2interactive »

Allright there's the console ouput:

Code: Select all


bullet-2.72/MultiThreadedDemo ; exit;
startThreads creating 4 threads.
PThread problem at line 163 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
starting thread 0
PThread problem at line 171 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
started thread 0 
starting thread 1
PThread problem at line 171 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
started thread 1 
starting thread 2
PThread problem at line 171 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
started thread 2 
starting thread 3
PThread problem at line 171 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
started thread 3 
PThread problem at line 57 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
PThread problem at line 72 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
Thread with taskId 0 exiting
Thread TERMINATED
PThread problem at line 57 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
PThread problem at line 72 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
Thread with taskId 1 exiting
Thread TERMINATED
PThread problem at line 57 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
PThread problem at line 72 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
Thread with taskId 2 exiting
Thread TERMINATED
PThread problem at line 57 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
PThread problem at line 72 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
Thread with taskId 3 exiting
Thread TERMINATED
sizeof SpuGatherAndProcessWorkUnitInput: 16
PThread problem at line 106 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
PThread problem at line 106 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
PThread problem at line 106 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
PThread problem at line 106 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
PThread problem at line 132 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
PThread problem at line 106 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
PThread problem at line 132 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1


After that the last block keeps repeating...


PThread problem at line 106 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
PThread problem at line 106 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
PThread problem at line 106 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
PThread problem at line 106 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
PThread problem at line 132 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
PThread problem at line 106 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
PThread problem at line 132 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
Enrico
Posts: 42
Joined: Thu May 17, 2007 9:34 am
Location: Stuttgart, Germany
Contact:

Re: MultiThreadDemo

Post by Enrico »

Hi,

the interesting lines are:
PThread problem at line 163 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
starting thread 0
PThread problem at line 171 in file Extras/BulletMultiThreaded/PosixThreadSupport.cpp: -1
Where the programs fails to create some required multithreaded stuff. Which is then the reason for all the other error messages and the not working collision detection.

Unfortunately I have absolutely no idea why these function calls fail and I have no access to Mac OS X to debug it :( :(
Can you get me a copy of the sem_init- and sem_overview-manual page from OS X? If you have time maybe we can debug it together? :)


Greetings,
Enrico
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: MultiThreadDemo

Post by Erwin Coumans »

It is probably best to avoid BulletMultiThreaded on non-SPU platforms, and simply run Bullet in a single (separate) thread.

First we need to improve performance of BulletMultiThreaded on non-SPU platforms, and fix the pthread issues.

Hope this helps,
Erwin
Post Reply