Re: Thread implementations...

Alex Belits (abelits@phobos.illtel.denver.co.us)
Sun, 21 Jun 1998 16:52:48 -0700 (PDT)


On Sun, 21 Jun 1998, John Summerfield wrote:

> I'm not sure what you mean by threads on Linux, but on OS/2 (with which
> I'm more familiar) different threads can be executing simultaneously on
> different processors in an SMP environment.

So are threads on Linux.

> To my mind this is one of the
> greater benefits of threads.

However separate processes on separate processors work even better.

> Along with the notion of using a separate
> thread to print (for example in wordprocessing software) and maybe
> handling some http requests in a web server, and ftp request in an ftp
> server.

Processes were used for that purpose since the invention of their
concept. For tasks that handle data independently and have to receive some
amount of initial data and then work independently or process existing i/o
streams, processes are more efficient, unless their management is poor
and requires large amount of process creation/exiting (early web servers
design, and inetd-based servers). In the situation where processing is
interdependent and requires reading/writing the same varables, mutexes in
threads can "serialize" processing at the extent where it will be
emulating one thread with asynchronous/nonblocking operation, and it will
negate the effect of SMP similar to the infamous low granularity locks
problem in SMP kernels.

--
Alex

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu