On Wed, 9 Jun 1999, Eugene Kuznetsov wrote:

> On Wednesday, June 09, 1999 1:11 PM, Joe [SMTP:[EMAIL PROTECTED]] wrote:
> > Netscape uses threads which in turn use "buzz" locks, (or short
> > spin locks) for mem locking. (OK)
> 
> Netscape uses user-mode threads, if I remember correclty, although perhaps 
> they're switching to real threads.  That would mean one process, and some 
> really unpleasant (and hang-prone) code switching contexts.  (SIGALRM, 
> etc.).
> 
> The whole question of whether "native" (i.e. _not_ usermode) threads should 
> be supported directly by the kernel or via processes is rather contentious. 
>  It bites both ways -- if one is moving from Linux to NT, the first thought 
> is: "NT stinks, the process creation overhead is terrible."  The answer is: 
> "Well, you should be using threads (or fibers)."  Coming from NT to Linux, 
> the first two thoughts are: "Linux stinks, it has only user-mode threads" 
> or "Linux stinks, if you want to use preemptive threads, you end up 
> creating one process per thread, plus a manager process, and that must be 
> slow!".  The answer is: "Yes, it does have native mode threads, and the 
> process overhead for Linux is less than that for NT."


I don't follow.  Linux _only_ has kernel-mode threads.  Each thread is a
unique process with its own PID and context.  Linux is just real slick
on doing the fork() by using the copy-on-write page-sharing trick...

But kernel-mode they are, and that is _all_ that you can do unless you
write your own thread library.  IE the pthreads library  uses kernel-level
processes for each thread...


> 
> So it's really a deep architectural debate, with pressure on Linux to get 
> special handling for processes that are really threads (e.g. keep all 
> "process threads" on the same processor, etc.) [re: linux-kernel a few 
> weeks ago] and with pressure on NT to get "lighter processes" (threads, 
> fibers, etc.).


linux _never_ keeps all threads on the same cpu.  Unless you only have one
cpu...





> 
> IMHO, in the future there will be convergence, with NT and Linux coming 
> towards each other on some of these issues.


I hope NT comes toward Linux... :)  Otherwise Linux will start
to suck.  :)




> 
>                                                       Eugene Kuznetsov
> 
> 
> 
> 
> 
> 

-
Linux SMP list: FIRST see FAQ at http://www.irisa.fr/prive/mentre/smp-faq/
To Unsubscribe: send "unsubscribe linux-smp" to [EMAIL PROTECTED]

Reply via email to