Learn them all (one at a time) and also WINAPI threads. They all do more or less the same thing. You'll probably want to prefer C++ threads, though, since it'll end up being the most portable. A typical thread lib doesn't really have an overwhelming number of components for you to learn. The problem is learning to use them in a sane fashion.What multithreading library would you recommend for C++? POSIX, boost?
Multithreaded programming
Slight nitpick: The speedup potential of parallel threads approaches the number of cores, not the number of threads.If the tasks you do in parallell has no dependencies on each other, you might get close to NumberOfThreads times the performance, but a game engine states is by its nature quite dependent on each other, having lots of requirements on what needs to be done before what, and is very tricky to multithread in an efficient way.
Annoying slight nitpick of nitpick: If task is CPU-bound.
Slight nitpick: The speedup potential of parallel threads approaches the number of cores, not the number of threads.If the tasks you do in parallell has no dependencies on each other, you might get close to NumberOfThreads times the performance, but a game engine states is by its nature quite dependent on each other, having lots of requirements on what needs to be done before what, and is very tricky to multithread in an efficient way.
Annoying slight nitpick of nitpick: If task is CPU-bound.
Supper annoying slight nitpick: or unless the task is superlinear, in which the speedup exceeds the number of cores.
Supper annoying slight nitpick: or unless the task is superlinear, in which the speedup exceeds the number of cores.Annoying slight nitpick of nitpick: If task is CPU-bound.
Slight nitpick: The speedup potential of parallel threads approaches the number of cores, not the number of threads.
If the tasks you do in parallell has no dependencies on each other, you might get close to NumberOfThreads times the performance, but a game engine states is by its nature quite dependent on each other, having lots of requirements on what needs to be done before what, and is very tricky to multithread in an efficient way.
Nitpick... annoying, etc: hyper-threading can give a speed up beyond the number of cores, due to hiding latencies.