Horde3D

Next-Generation Graphics Engine
It is currently 20.04.2024, 03:23

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 10.07.2012, 05:36 
Offline

Joined: 10.07.2012, 05:30
Posts: 1
What is the threading model of Horde? Suppose I have a game with a render thread using horde and a separate game logic thread. What happens if the game logic thread tries to update the scene graph while the render thread is reading from the scene graph to make opengl calls to render? Does Horde support this and if so how does it implement it?


Top
 Profile  
Reply with quote  
PostPosted: 10.07.2012, 08:22 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Horde is not thread safe.


Top
 Profile  
Reply with quote  
PostPosted: 10.07.2012, 08:58 
Offline

Joined: 15.02.2009, 02:13
Posts: 161
Location: Sydney Australia
Hi chare,

Perhaps a possible approach if you don't plan on doing callbacks or things from the Horde scene graph and you manage all transform-related interactions in your game logic thread, you could perhaps double-buffer all your transforms into a list, then wrap that list into a mutex lock and feed Horde's scene graph on the Horde thread. Reading back transforms from Horde itself might be tricky then without additional expensive mutex locks, so best to manage that stuff in the game-logic thread only (and probably the smart approach if you do things in future like a client/server-separated game and you want the server headless and not relying on an OpenGL-interacting library, depends on your engine).

There is a plan to remove the scene graph in future so Horde is purely submission-based rendering, which might mean more threading options as well (but you'd be responsible for your own scene representation).

_________________
-Alex
Website


Top
 Profile  
Reply with quote  
PostPosted: 10.07.2012, 16:33 
Offline

Joined: 19.01.2012, 21:01
Posts: 55
MistaED wrote:
Perhaps a possible approach if you don't plan on doing callbacks or things from the Horde scene graph and you manage all transform-related interactions in your game logic thread, you could perhaps double-buffer all your transforms into a list, then wrap that list into a mutex lock and feed Horde's scene graph on the Horde thread.


This is kind of what I'm planning. I'm using my Go implementation, and Go has some nice concurrency primatives. I plan on queuing up all of transformations ( or probably easier all of my calls into the horde3d api) from different threads, and just apply them on one thread when all of my Go channels return.

So all of my horde3d interfactions will be single threaded, but everything else will be multi-threaded. So I could be calculating my A* path for my AI in one thread, and the Bullet physics call in another thread, and when they complete both transformations will be applied in order to the horde3d API call.

That's the idea at least. We'll see.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group