Multi-Core Programming / C++
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]
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.
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.
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.
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?
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement