Multithread Irrlicht

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.

Multithread Irrlicht

Postby yamashi » Sat Nov 14, 2009 3:11 pm

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.
yamashi
 
Posts: 82
Joined: Sat Jan 03, 2009 4:53 am

Postby Nox » Sat Nov 14, 2009 3:13 pm

Answer: irrlicht is designed for single thread.
Nox
 
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Postby yamashi » Sat Nov 14, 2009 3:17 pm

ok thanks.
I will have to work my way around it then ^^
yamashi
 
Posts: 82
Joined: Sat Jan 03, 2009 4:53 am

Postby BlindSide » Sun Nov 15, 2009 1:39 am

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
BlindSide
Admin
 
Posts: 2797
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Postby 3DModelerMan » Sun Nov 15, 2009 2:25 am

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/3DModelerMan/replicator#tipjar
User avatar
3DModelerMan
 
Posts: 1691
Joined: Sun May 18, 2008 9:42 pm

Postby yamashi » Sun Nov 15, 2009 11:46 am

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 ?
yamashi
 
Posts: 82
Joined: Sat Jan 03, 2009 4:53 am

Postby Nox » Mon Nov 16, 2009 2:32 pm

25 threads....are you sure that you dont loose the performancegain by the interthread communication?
Nox
 
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm

Postby hybrid » Mon Nov 16, 2009 9:59 pm

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.
hybrid
Admin
 
Posts: 13946
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany

Postby Nox » Tue Nov 17, 2009 4:16 pm

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.
Nox
 
Posts: 304
Joined: Wed Jan 14, 2009 6:23 pm


Return to Open Discussion and Dev Announcements

Who is online

Users browsing this forum: No registered users and 0 guests