C++ Boost question about loops.
So I've been looking over as much information as I can and still not seeing any examples of what I am trying to do or the principles of how it works.
I've been working in my spare time for a few years on designing a game in C++. I got my Core engine for the game logic all figured out as well as a rough Input system and using OpenGL and AL for output. What I want to do is figure out how to get my Engine to start and Then run my Input System, Graphics Engine, and Sound System in separate threads. and all run at the same time. Syncing my threads be the next step but I can't get the threads to run together.
boost::thread gTrd(boost::bind(&game::runGraphics, this));
gTrd.join();
boost::thread sTrd(boost::bind(&game::runSound, this));
sTrd.join();
boost::thread iTrd(boost::bind(&game::runInput, this));
iTrd.join();
boost::thread cTrd(boost::bind(&game::runCore, this));
cTrd.join();
That's What I got so far. Problem is as far as I can see is that the Graphics Engine in gTrd has an infinite loop thats suppose to keep going until program terminates so I get my blank screen up but it never starts the sTrd.
What exactly is needed to make it so I can run my threads which are in theory indefinite threads? Also any potential problems I need to look out for in terms of memory leaks be awesome to know.