|
-
Oct 26th, 2003, 10:51 PM
#1
Originally posted by Madboy
Ummmm........
Whats multi-threading and what does it do/whats it for?
In multithreading, a single process can call several calls. Or you can look at it another way and say that it's the simultaneious execution of several function flows or "threads".
This is possible if these threads are not dependent upon one another. Since these threads aren't dependent upon one another, it's advantageous to have several different portions of the programs being executed in the most optimum way, instead of having them execute in a serial fashion. I can give you a very small example here:
Let's say we're to evaluate the following expression
a=92
b = a + 382
c = a*b + a^2
d = 283+ 28+a
x = a^2 + 2bc + c^2
Now if we were to implement multithreading on this, you can easily see that d is independent of b, c and x. "a" is a constant in it, so while the evaluation of b and c are going on, we can get the "d" thread to work, evaluate d, and after b and c get evaluated, we plug them into x.
This is a redundant example because you wouldn't notice the performance difference on something like this. But there are areas and applications where multithreading would be of good use to you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|