|
0 registered members (),
1,459
guests, and 9
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
boost up you game... (use multithreading!)
#252827
02/20/09 18:14
02/20/09 18:14
|
mercuryus
OP
Unregistered
|
mercuryus
OP
Unregistered
|
Here's a tiny example of implementing threads in you lite-c application. download example (2.2MB) But be warned! Multithreading is not that easy to use and the syncronisation may be a challenge sometimes... mercuryus
|
|
|
Re: boost up you game... (use multithreading!)
[Re: Joey]
#252830
02/20/09 18:22
02/20/09 18:22
|
mercuryus
OP
Unregistered
|
mercuryus
OP
Unregistered
|
The problems may accour in detail. The cube-demo (multithread_crashes.c) works on my single-core system but crashes at the dualcore system. dunno why?
|
|
|
Re: boost up you game... (use multithreading!)
[Re: ]
#252833
02/20/09 18:36
02/20/09 18:36
|
Joined: Oct 2007
Posts: 5,210 İstanbul, Turkey
Quad
Senior Expert
|
Senior Expert
Joined: Oct 2007
Posts: 5,210
İstanbul, Turkey
|
add a
while(key_t) wait(1);
after
if(key_t && gv_cubes<MAX_THREADS){
change in speed is magnificant, but idk if it reaaly worths it? (at least from my programmin skill level.)
3333333333
|
|
|
Re: boost up you game... (use multithreading!)
[Re: Joey]
#252845
02/20/09 20:01
02/20/09 20:01
|
mercuryus
OP
Unregistered
|
mercuryus
OP
Unregistered
|
Maybe it's possible to handle all particle effects in an separate thread or animations not need to be synchronised with gameplay (maschines/clocks/cloudes/fog/light/create dynamic content...).
But an extra thread is not "extra (so far unused) power" - a busy/overloaded thread can effect the main programm!
|
|
|
Re: boost up you game... (use multithreading!)
[Re: FBL]
#252960
02/21/09 20:21
02/21/09 20:21
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
Expert
|
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Hey TechMuc, what do you think about the safety of using the threads for directx vertex manipulations and entity texture changes(ent_setskin)?
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
|
|
|