From: | |
Date: | 20 Feb 2001 at 12:17:15 |
Subject: | Re: Tasks vs. Threads |
Hello Gabriele
On 20-Feb-01, you wrote:
> First of all what are the differences between tasks and threads? I
> suppose that the more 'portable' approach is by using threads (since
> unix clones seem to use that), what are the other advantages of a method
> over the other? Can someone shed a little of light on this poor
> single-task coder? ;-) Thanx in advance guys
>
Threads are often referred to as light weight processes (processes are the
same as tasks) and are identical in many respects to real processes.
However, they confer several advantages. The most important, is the reduced
overhead on the operating system - the effort required to create a new
process and to context switch is completely avoided..
Instead, the parent process (threads are always controlled by a parent
process) performs the thread context switching itself - or if you use
pthreads or similar, the library code will do this. In other words, threads
are switched within the time slice available to the parent process.
I personally don't see the point of them on the Amiga, as the AmigaOSs
scheduler works just great. The reason pthreads exists at all is because
many UNIX implementations have "inefficient" schedulers (they do more work
than they need to) and certain types of process benefit greatly from the
reduced overhead of threads.
Regards
Steve
------------------------ Yahoo! Groups Sponsor ---------------------~-~>
eGroups is now Yahoo! Groups
Click here for more details
http://click.egroups.com/1/11231/0/_/451227/_/982671525/
---------------------------------------------------------------------_->