Is this commonly done? How much performance loss is there if I don't use more than one thread?
Thanks,
Dennis
Printable View
Is this commonly done? How much performance loss is there if I don't use more than one thread?
Thanks,
Dennis
First of all; are you going to try threads in VB????
But now back to the question. You should only use threading in games when a task has to be done independantly from the main loop, or you would have to synchronize the two, which basically defeats the purpose of a thread. You might see a little increase in speed, but mostly you won't notice it...
I can't think of much use for threading in games.... well, maybe the loading screen, so you can load the graphics and sounds while an animation plays or something... but I think most games rely on the 'moving, drawing, moving, drawing' loop...
I think implementing a good threading system just takes too much time, especially for the one-man (or woman) programmers...
But offcourse I can be totally wrong :)
you might be. Network games might run a lot faster if there's another thread checking for incoming messages and replies according to them. Anyways, I'm about to develope a game which has it's GUI running on a separate thread, but this is a special case, my game will eat more performance on game variable calculations than on rendering the GUI so it's a case where you could benefit from asyncronisation. Also my GUI message queue system will probably be multithreaded until i come up with a reason it's unnessesary. If you make a game with a low framerate you could run the mouse on another thread which checks the mouse for movement frequently.
Multithreading isn't too hard to accomplish, i picked up some ADT classes that can be derived for threads, which included mutexes to protect accessed data.
Absolutely NOT!!! I don't code in VB anymore unless I'm really bored and am helping someone... C++ Rules!!!! :D:D:D:DQuote:
Originally posted by PsychoMark
First of all; are you going to try threads in VB????
hehe
I didn't even think you COULD use multithreading in VB..
You can multithread in VB but its soooooooooooo un-secure and messes alot. i agree tho C++ is like "**** vb" now :D
I would agree that the most use multiple threads get in games are for multiplayer, and a UI. A few months ago, i was reading through the documentation for UnrealScript, and one of the things that they did was have Latent functions, which would continue to operate over multiple frames, but they didnt use threads. The reason, was because apparently windows doesnt handle thousands of simultaneous threads (im sure). A game design should work well enough to not have to use threads.
As to threads in VB, you CAN use them in version 5, but its impossible in 6.
Z.
What? Huh? *** would MS do that?!?!?!? :confused:
Maybe because they realised it was too unstable :D
Well, in that case, they should've just trashed the whole VB project, and concentrated on making VC++ better :D:D:D
There's too many VB fans out there (especially here) and MS would loose a lot of $$ on it, vb.net gives them $$, but I still hope they're going to improove VC++