Is it important to know/use threads when doing Windows programs?
Can you give a (real) example where it's useful, and where you absolutely HAVE TO use it?
Is it important to know/use threads when doing Windows programs?
Can you give a (real) example where it's useful, and where you absolutely HAVE TO use it?
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
Thread is imperative for Windows as well as program on all other operating systems. Without the use of threads, there is no way a process or processes could perform multiple tasks. Multithreading and multiprocessing are standards for multitasking and multiusers operating systems.
For example, consider a Windows game such as the upcoming Unreal Tournament 2003. You cannot do calculations and update gamers graphically in real-time without using multithreading and multiprocessing.
Kuphryn
If you do them one at a time, you get the illusion of them being done at the same time.
If I'm not mistaken, threads doesn't execute several codes "at the same time", it only runs parts from one code, then a little form the next etc...Code:while(MainLoopIsOn) { GetPlayerInput(); MovePlayers(); MoveEnemies(); UpdateScreen(); }
Anyway, it's not my intention to argue against you.
Thanks for the reply!
MagosX.com
Give a man a fish and you feed him for a day.
Teach a man to fish and you feed him for a lifetime.
Yeah...but assume each of these 4 functions tales up .25 seconds on a normal priority thread running in the system with all the other threads........now to complete this block, you have lost 1 second......if they were multithreaded you would get closer to .25 seconds....not bad if it worksOriginally posted by Magos
If you do them one at a time, you get the illusion of them being done at the same time.
Code:while(MainLoopIsOn) { GetPlayerInput(); MovePlayers(); MoveEnemies(); UpdateScreen(); }
Yeas but it does this very fast.....when you create anoter thread, you have 2 chances of execution instead of 1...therefore, to all reason, they are running at the same time (or very close)Originally posted by Magos
If I'm not mistaken, threads doesn't execute several codes "at the same time", it only runs parts from one code, then a little form the next etc...