|
-
Nov 28th, 2001, 07:00 AM
#1
Thread Starter
Hyperactive Member
What is 'multi-threaded' ?
Hi,
I often hear ppl saying multi-threaded or multi-thread applications from time to time. But can anyone tell me what exactly is a multi-threaded program?
thnx in advance
-
Nov 28th, 2001, 07:09 AM
#2
Conquistador
have a look on www.planetsourcecode.com
for
"multi tasking"
-
Nov 28th, 2001, 07:12 AM
#3
Well ...
The CPU of a computer is able to execute only one process at any given point of time. When multi-tasking came into existence, it made efficient use of the CPU's huge speed by introducing the time shares. A certain piece of time is given to each process to execute. Once the time slice is up, the process is put on hold, and the next process is taken up for execution. Since the CPUs run at huge speeds, you wouldn't notice this and think that the processes are running parellel.
The same concept, when applied to an individual process, becomes multi-threading. A single process, when being executed, executes line by line. You can identify code segments in your process which do not need to be run one after the other. This means, both the code segments would give the same result if run simultaneously, they wouldn't affect each other's working if both were run together. In such a case, the process is split into threads, and each thread runs for a slice of time, then is put on hold and the next thread is run and so on.
In short, if you know how multi-tasking works conceptually, multi-threading is almost the same in concept.
.
-
Nov 28th, 2001, 07:22 AM
#4
Thread Starter
Hyperactive Member
I think i get the idea. But to help me understand it a lil more, can someone upload a very basic app that demonstrates the process pls?
many thnx
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
|