|
3 registered members (AndrewAMD, Martin_HH, 1 invisible),
4,731
guests, and 3
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: boost up you game... (use multithreading!)
[Re: carlpa]
#342640
09/29/10 19:54
09/29/10 19:54
|
Joined: Jul 2006
Posts: 40 North Europe
DeepReflection
Newbie
|
Newbie
Joined: Jul 2006
Posts: 40
North Europe
|
Partly if we talk a Pentium 4 CPU up to HT (single core), still it would stop the main thread run the other and then resume where it was. So technically it's the same but different. Today most/all CPUs is multicore like Dual, Quad or i7 (8 cores) when kicking of a new thread this will take advantage of the cores still idle or low utilized (and run in parallel). Still the main thread will run at full speed so to say. Multithread make it possible to lift out heavy or slow processes from the main thread to run on an own thread and utilize the full potential of multicore CPUs if available. Of course this also turn around how you program since you must make algorithms to take care of scheduling and keep track of all threads so you don't start to use results that still is not calculated or overwrite results that not yet has been used, but that is a totally other topic.
Whoever has the gold makes the rules.
|
|
|
Re: boost up you game... (use multithreading!)
[Re: DeepReflection]
#342642
09/29/10 20:01
09/29/10 20:01
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Partly if we talk a Pentium 4 CPU up to HT (single core), still it would stop the main thread run the other and then resume where it was. So technically it's the same but different. No, because the scheduler guarantees each thread X time units (probably microseconds, I don't know how the Windows scheduler works in detail). When you spawn another thread, you have two times X time units (well, probably the second thread won't get the same time as the main thread and there is also the thing with priorities). So, even with just one CPU Core you can still boost up your game by moving stuff into a second thread.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: boost up you game... (use multithreading!)
[Re: WretchedSid]
#342649
09/29/10 20:35
09/29/10 20:35
|
Joined: Jul 2006
Posts: 40 North Europe
DeepReflection
Newbie
|
Newbie
Joined: Jul 2006
Posts: 40
North Europe
|
True, but to a cost for other running applications, OS core functions and services since there is still only one CPU to spread the workload on. My answer was a general on benefits from multithreading with multicore CPU since that is what most people have in their PC nowadays. Nitpicking on hardcore details was never my intention.
Whoever has the gold makes the rules.
|
|
|
Re: boost up you game... (use multithreading!)
[Re: DeepReflection]
#342690
09/30/10 06:12
09/30/10 06:12
|
Joined: Dec 2006
Posts: 1,086 Queensland - Australia
Nidhogg
Serious User
|
Serious User
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
|
I remember reading that multi threads within GS are benificial when using them multi media functions.
Windows XP SP3 Intel Dual Core CPU: E5200 @ 2.5GHz 4.00GB DDR3 Ram ASUS P5G41T-M LX PCIE x16 GeForce GTS 450 1Gb SB Audigy 4 Spyware Doctor with AntiVirus
|
|
|
Re: boost up you game... (use multithreading!)
[Re: Nidhogg]
#342693
09/30/10 07:02
09/30/10 07:02
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
Are you talking about this thread: http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=341634#Post341634 ? If so, this reads more like "we are using already multithreading for media functions" and not like "media functions would be faster if you knew how to spawn a thread." Btw, not only media functions can be faster, everything that isn't time critical can be boost up. Eg. HTTP Requests or every other operation that uses the network should run asynchronously in another thread. Also Pathfinding could run in a second thread.
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
Re: boost up you game... (use multithreading!)
[Re: WretchedSid]
#342730
09/30/10 13:59
09/30/10 13:59
|
Joined: Dec 2006
Posts: 1,086 Queensland - Australia
Nidhogg
Serious User
|
Serious User
Joined: Dec 2006
Posts: 1,086
Queensland - Australia
|
@JustSid Your right sorry about that.
As quoted from jcl: The engine itself can not use multiple cores because the main engine functions must run in a certain order.
But side functions, such as video or audio streaming, use multiple cores. You can also use them the way described above when you have time consuming functions.
Windows XP SP3 Intel Dual Core CPU: E5200 @ 2.5GHz 4.00GB DDR3 Ram ASUS P5G41T-M LX PCIE x16 GeForce GTS 450 1Gb SB Audigy 4 Spyware Doctor with AntiVirus
|
|
|
|