4 registered members (AndrewAMD, VoroneTZ, Quad, 1 invisible),
826
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: boost up you game... (use multithreading!)
[Re: Joozey]
#331672
07/05/10 17:09
07/05/10 17:09
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
G'day mercuryus. Sorry to resurrect an old thread, but your link no longer seems valid.
Is it possible for you to put the example up again?
Thanks,
Jibb
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: boost up you game... (use multithreading!)
[Re: JibbSmart]
#331765
07/06/10 06:14
07/06/10 06:14
|
mercuryus
OP
Unregistered
|
mercuryus
OP
Unregistered
|
I cleared up my webserver (to free space). Multithreading was downloaded too few in the last time - so I deleted it.
But I will put it on the server the next days again...
|
|
|
Re: boost up you game... (use multithreading!)
[Re: CoburnDomain]
#331860
07/06/10 15:49
07/06/10 15:49
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
@mercuryus: Thanks.
@CoburnDomain: One thread will generally be busier than the other. If it's the main thread, the secondary thread will probably just spend some time waiting for the main thread to be ready, but on a multi-core CPU that's still much better than having it all in one thread. If other threads end up being really busy (busier than the main thread) you'll either have the main thread wait for them (which really removes much of the usefulness of threading), or have the other threads notify the main thread when they're ready.
For example, if for some reason you needed an extremely expensive path-finding algorithm (it's not always about reaching a single position) you'd put it in another thread to avoid a pause whenever a new path is calculated. Each unit that requests a new path will continue what they were doing (or just wait) without pausing the main thread until they are notified by the secondary thread as to when they can move.
Or at least, that's my understanding. You'll still need to be really careful as to how the secondary thread will notify the main thread.
Jibb
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: boost up you game... (use multithreading!)
[Re: JibbSmart]
#331898
07/06/10 17:10
07/06/10 17:10
|
mercuryus
OP
Unregistered
|
mercuryus
OP
Unregistered
|
|
|
|
Re: boost up you game... (use multithreading!)
[Re: JibbSmart]
#342283
09/26/10 07:48
09/26/10 07:48
|
mercuryus
OP
Unregistered
|
mercuryus
OP
Unregistered
|
|
|
|
Re: boost up you game... (use multithreading!)
[Re: Liamissimo]
#342619
09/29/10 17:59
09/29/10 17:59
|
Joined: Feb 2006
Posts: 52
carlpa
Junior Member
|
Junior Member
Joined: Feb 2006
Posts: 52
|
Question?
I am correct in saying: The major benefit of multithreads is allowing a complex algorithm to run while also running the engine.
Would intermittent "wait(1)" commands in the algorithm perform a similar function?
Thanks
Researcher & clinician. A6, A7, & A8 First computer a Commodore Pet
|
|
|
Re: boost up you game... (use multithreading!)
[Re: carlpa]
#342631
09/29/10 18:33
09/29/10 18:33
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
no, because the algorithm still eats the CPU time of the main thread
Shitlord by trade and passion. Graphics programmer at Laminar Research. I write blog posts at feresignum.com
|
|
|
|