Asynchronous in C++? Running multiple functions simultaneously?

Oct 19, 2009 at 7:59am
I'm making a game, and it'd be awfully useful to have multiple functions running simultaneously, but I don't see that this is an option in C++ (or any of the few languages I've touched in my life). Any explanation, direction, or help would be appreciated.
Oct 19, 2009 at 8:06am
Multi-threading?
Oct 19, 2009 at 4:02pm
Thank you. At least now I have somewhere to start reading. (I'm programming illiterate.)
Oct 19, 2009 at 4:20pm
I would also wait for a few replies first before you start focusing on one method. I have never done game programming and am also a beginner myself, so there may be a better option.
Oct 19, 2009 at 5:40pm
Keep in mind that a multi-threaded application is really only running multiple functions simultaneously if it's running on a multi-core system, and even then also if none of those functions are blocking each other.

And while multi-threading is the primary method of accomplishing this, there are a variety of libraries available to build a multi-threaded application. You can use the OS provided calls, use the boost library, and while the current C++ standard does not provide thread support, C++0x does provide standard support for threading, when it's finally released. There are a number of other C++ library that provide support for multi-threading as well.
Oct 20, 2009 at 6:54am
Very true, and I actually managed a solution without multi-threading. Allegro's readkey() in my while loop was unnecessary and was weighing things down heavily.

jRaskell, thanks, I started reading that document, too. Didn't seem worth my time at my level right now.
Topic archived. No new replies allowed.