Jump to content
  • Advertisement
Sign in to follow this  
beebs1

Multi-Core Programming / C++

This topic is 4022 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hiya, I've been looking into multi-core processors, which seem to be becoming more and more popular. Does anyone know how to program for CPU's which more than one physical core? I've had a peek at OpenMP, but it seems a bit heavy duty for games (at least for the type I'm writing), more geared towards distributed processing and the like. I thought about using SetProcessAffinityMask(), but everything I've read says not to. Does programming for multiple cores just involve designing a good threading strategy, and letting the kernel do the hard work? The only thing you'd have to watch for are race conditions and the like. Thanks for any explanations or help [smile]

Share this post


Link to post
Share on other sites
Advertisement
Yes, the best idea is to design a correct multi-threaded system (both deterministic and asynchronous), and the kernel will automatically distribute the threads to as many processors as possible.

Share this post


Link to post
Share on other sites
Quote:
Original post by visage
I concur with the above post -- let the kernel handle it.
Here is an excellent book you should read when designing parallel algorithms: Designing and Building Parallel Programs.

Also, reading anything about Erlang will also help get you in the right mind set.


I don't suppose you have a working link for that?

Share this post


Link to post
Share on other sites
Nope, I meant this. I don't think you really need to read the whole thing -- just part 1, which is the concepts. Then try to start employing concurrent computations, with AliceML, Erlang, Ruby's DRb -- whatever tool you would like.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!