Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


Multithreaded programming


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
24 replies to this topic

#21 Khatharr   Crossbones+   -  Reputation: 3030

Like
0Likes
Like

Posted 26 February 2013 - 11:01 PM

What multithreading library would you recommend for C++? POSIX, boost?

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.
void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

Sponsor:

#22 Nercury   Crossbones+   -  Reputation: 770

Like
0Likes
Like

Posted 27 February 2013 - 02:13 AM

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.

Slight nitpick: The speedup potential of parallel threads approaches the number of cores, not the number of threads.

Annoying slight nitpick of nitpick: If task is CPU-bound.



#23 Hodgman   Moderators   -  Reputation: 30878

Like
0Likes
Like

Posted 27 February 2013 - 02:29 AM

 

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.

Slight nitpick: The speedup potential of parallel threads approaches the number of cores, not the number of threads.

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.



#24 EWClay   Members   -  Reputation: 659

Like
0Likes
Like

Posted 27 February 2013 - 05:31 AM



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.

Slight nitpick: The speedup potential of parallel threads approaches the number of cores, not the number of threads.
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.

Nitpick... annoying, etc: hyper-threading can give a speed up beyond the number of cores, due to hiding latencies.

#25 Khatharr   Crossbones+   -  Reputation: 3030

Like
1Likes
Like

Posted 27 February 2013 - 06:35 AM

Natpick: Hyperspatial computing can provide the results of concurrent operations prior to program start.
void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS