Is Irrlicht threadsafe?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
MeisterK
Posts: 66
Joined: Sat Feb 26, 2005 1:20 pm

Is Irrlicht threadsafe?

Post by MeisterK »

Does anybody knows wether Irrlicht is threadsafe on Win32 or not?

I inspected the sources an doesn't found a clue that it is, but I just want to go for sure.

As threadsafe it would be enough for me if one thread is executing the engine while other threads (one or many) are manipulating the scene.

Any expierence?

Thx

Thorsten
schick
Posts: 230
Joined: Tue Oct 07, 2003 3:55 pm
Location: Germany
Contact:

Post by schick »

It is not threadsafe.
Please send me an e-mail instead of a private message.
aigam
Posts: 17
Joined: Fri May 06, 2005 3:17 pm

Post by aigam »

Is really a bad idea to make a graphic engine with threads... but you can make your game in threads... only that the engine must be in one thread...
MeisterK
Posts: 66
Joined: Sat Feb 26, 2005 1:20 pm

Post by MeisterK »

aigam wrote:Is really a bad idea to make a graphic engine with threads... but you can make your game in threads... only that the engine must be in one thread...
Hmm, I never planned to do this and understanding this right would mean Irrlicht is threadsafe!? Sure the rendering is done with only one thread but changing the scene, etc is done by another thread at ANY time.
aigam
Posts: 17
Joined: Fri May 06, 2005 3:17 pm

Post by aigam »

You must mantain all the elements of irrlicht in one thread, but you can make all the rest of your code with multithreading.

You must separate all the render engine of your game with the game engine.

Render engine
|
|-game engine thread 1 (player a)
|-game engine thread 2 (player B)
|-game engine thread 3 (IA)

For example...
you must make a bridge between the render and the game engine.

But I recommend you to not use threads... in games is really most optimal to use multi-steps.
MeisterK
Posts: 66
Joined: Sat Feb 26, 2005 1:20 pm

Post by MeisterK »

What do you mean with 'multi-steps'?
aigam
Posts: 17
Joined: Fri May 06, 2005 3:17 pm

Post by aigam »

Divide a operation in multiple frames... the ia for example is a good multi-steep proces, you don't need a inmediate result.
hybrid

Post by hybrid »

aigam wrote:Is really a bad idea to make a graphic engine with threads
This is definitely correct for Hardware accelerated modes (you only have one hardware acceleration, so what should other threads do) but the software renderer would benefit from multiple threads. Probably not as much as common raytracer do, but you should be able to use substantial ressources from a second processor if you are able to split your render target into pieces. Or if you use doublebuffer and have a thread per buffer.
keless
Posts: 805
Joined: Mon Dec 15, 2003 10:37 pm
Location: Los Angeles, California, USA

Post by keless »

What I'd like to see is a thread on resource loading, where textures/models are drawn with a temporary figure until the real resource is loaded in-- this means resource loading is not blocking which is helpful for large levels where resources have to be loaded and unloaded on the fly.
a screen cap is worth 0x100000 DWORDS
Post Reply