BBS水木清华站∶精华区

发信人: reden (鱼 ~ 梦娜丽莎的微笑 流星的故事), 信区: Linux 
标  题: Re: 关于线程 (转载) 
发信站: BBS 水木清华站 (Sat Dec 12 01:56:56 1998) 
 
【 以下文字转载自 Unix 讨论区 】 
【 原文由 rainland 所发表 】 
【 在 hmv (任我行) 的大作中提到: 】 
 UNIX中线程的概念是怎样的呢? 
 和WINDOWS  NT中一样吗? 
under unix, there are two kinds of thread: 
kernel thread and user thread, posix thread  
lib refers to user thread, and they map user 
threads to kernel threads. 
Serveral kernel threads usually serve a lot of  
user threads, that is because too many kernel 
thread will choke OS. 
 
under win32, no user threads, 
that's to say, user thread equal to 
kernel thread. 
 
 用什么函数创建呢? 
under win32, the basic way is to  
call CreateThread. 
 
under unix, it is up to the  
thread lib that you use.  
For example, in posix thread lib, 
you could call pthread_create. 
In the SUN thread lib, 
things are different, but I am  
not quite sure about the related  
call. 
 
 
-- 
 
  Roses are red                              / / / / / / / / / / / / / / / / / 
  Violets are blue                         / / / / Farmland in rain/ / / / / 
  To you, ... , I will always be true.   / / / / / / / / / / / / / / / / / 
 
※ 修改:·rainland 於 Dec 11 13:56:22 修改本文·[FROM: dell.net.tsingh] 
※ 来源:·BBS 水木清华站 bbs.net.tsinghua.edu.cn·[FROM: dell.net.tsingh] 

BBS水木清华站∶精华区