That's why I'm planning to use a Event based approach. I do already have an event queue, I just need to make it thread-safe.Granyte wrote:actualy doing physics in a thread require some sort of mutex itself because when the physics update a node position while smgr->drawall() is runing you will still get a wonderfull crash
using the Quad core
Re: using the Quad core
Dustbin::Games on the web: https://www.dustbin-online.de/
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Dustbin::Games on facebook: https://www.facebook.com/dustbingames/
Dustbin::Games on twitter: https://twitter.com/dustbingames
Re: using the Quad core
interesting for now i'm using atomic operation on bool to lock some operation from the rendering loop and other from the physic loop depending on what the other thread is doing
it's primitive but it works if i start to need more thread i might implement it as a thread/flag manager
and i'm actualy thinking on making a 3rd thread for my game loop instead of having it in the render loop and since bullet seem thread safe to some extent
it's primitive but it works if i start to need more thread i might implement it as a thread/flag manager
and i'm actualy thinking on making a 3rd thread for my game loop instead of having it in the render loop and since bullet seem thread safe to some extent
Re: using the Quad core
And I was thinking just being lazy and using OpenMP.
Re: using the Quad core
The simplest thing, as it has been said many times, is to keep all the Irrlicht related stuff in the main thread, and use the rest as you see fit.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: using the Quad core
the problem is you still need to update the nodes from the other threads
-
- Posts: 1691
- Joined: Sun May 18, 2008 9:42 pm
Re: using the Quad core
If you use an event system then it shouldn't be too big of a problem.
That would be illogical captain...
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar
My first full game:
http://www.kongregate.com/games/3DModel ... tor#tipjar