Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, dr_panther, VoroneTZ), 837 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 4 of 4 1 2 3 4
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
D
DeepReflection Offline
Newbie
DeepReflection  Offline
Newbie
D

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. laugh

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 Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Originally Posted By: DeepReflection
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. laugh

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
D
DeepReflection Offline
Newbie
DeepReflection  Offline
Newbie
D

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 Offline
Serious User
Nidhogg  Offline
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 Offline
Expert
WretchedSid  Offline
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 Offline
Serious User
Nidhogg  Offline
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
Re: boost up you game... (use multithreading!) [Re: Nidhogg] #343229
10/04/10 15:53
10/04/10 15:53
Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
Puppeteer Offline
Expert
Puppeteer  Offline
Expert

Joined: Jan 2007
Posts: 2,247
Deutsch Niedersachsen
so tracing wouldnt work in a new thread?


Formally known as Omega
Avatar randomness by Quadraxas & Blade
http://omegapuppeteer.mybrute.com
Page 4 of 4 1 2 3 4

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1