Multithread Irrlicht

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
yamashi
Posts: 82
Joined: Sat Jan 03, 2009 4:53 am

Multithread Irrlicht

Post by yamashi »

Hello !

I thought about multithreading irrlicht using OpenMP but the few stuff that I tried to multithread are not thread safe (OnRegisterSceneNode...)
So I was wondering if irrlicht is possible to multithread ? or was irrlicht designed for single thread and multithreading would mean to modify the whole irrlicht architecture ?

Thanks.
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

Answer: irrlicht is designed for single thread.
yamashi
Posts: 82
Joined: Sat Jan 03, 2009 4:53 am

Post by yamashi »

ok thanks.
I will have to work my way around it then ^^
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

You can probably use OpenMP on a few things like the loop that skins meshes or generating Octrees but I tried it once (For skinning a mesh) and didn't get any speed up because the amount of data is fairly small to be shared amongst threads and the thread over head pretty much killed any performance advantage.

The problem is that most "looping" operations in a scene graph are recursive and not iterative so it's hard to use OpenMP or TBB to multithread it efficiently.
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
3DModelerMan
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Post by 3DModelerMan »

Well I'm sure if you ran physics and AI stuff in seperate threads you might get some performance... :?:
That would be illogical captain...

My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
yamashi
Posts: 82
Joined: Sat Jan 03, 2009 4:53 am

Post by yamashi »

I am already running physics on 16 threads, AI is server side, network is running on 4 threads, lag reduction on 4 threads as well, so that's already 24+1 threads but they are usually light weighted... A network thread doesn't do much but wait for a message or send a message...
What about culling algorithms ? Are they recursive ?
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

25 threads....are you sure that you dont loose the performancegain by the interthread communication?
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

If you only do data parallelism there's no inter-process communication. And since many threads are waiting most of the time such situations can be really useful. Shaders run with up to several thousand threads on moden gfx cards.
Nox
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Post by Nox »

Well. Long live CUDA! But not many processes can be completely seperated like rendering or particledrift calculations. And even those are mostlikely done by the "frame by frame" scheme (assuming that they only correlate with the old state). I.e. lagreduction based on interpolation and physical computations interfere with eachother afaik. And meanwhile the network may try to bring in the new datas. All in all i think there is a lot of communication needed.
Post Reply