Hey there I was wondering what multi-threading is. I have seen many posts about it but they only tell how to do it not really what is it or what it does. Could someone tell me what it is used for? Thanks. All for now.
Printable View
Hey there I was wondering what multi-threading is. I have seen many posts about it but they only tell how to do it not really what is it or what it does. Could someone tell me what it is used for? Thanks. All for now.
this will be quite veigue ... but hopefully will give you the idea
on your os ... you have a process table
this is where your apps put in requests for proccessor time
a single thread is a request for 1 lot of processor time, each thread has a limmited lifetime so that if the program crashes it doesnt completely occupy the proccessor .....
anyway ....
the processor works in a round robin sort of way so that each apps gets a fair share ...
but if an app has multiple threads ... it means that it has multiple entries in this table and thus gets more processor time ....
also
only 1 thread can be proccessed at any one time ...
if you have a multiple processor machine and your app only has 1 thread ... it will never utilize more than 1 proccessor at a time ... but if it has more than 1 thread the system is then able to use both proccessors symultaniously meaning that you app should function faster ........
conclusion
multi threading will make your app run faster wether you have multiproccessor system or not
without multithreading you app will not take advantage of a multiprocessor environment
now if someone could write this up so that it makes proper sence it would probably help ... lol
:p :p :p :p :p :p
Thanks, aturner, for the info. Even though, as you said, your description was a bit vague, I think I get the concept now. Thanks for your feedback.