Re: Newbie questions



On Thu, Apr 26, 2001 at 06:37:18PM -0400, Paul Davis wrote:
> >I plan to install the latest 2.4 kernel, Red Hat 7.1 distro.  I'm sure
> >it will include GTK+, glibc, etc.  Will that be GTK+ 1.2 or 2.0, or
> >both?  Is there a reason why I would want one over the other?  Also, I
> >have probably every RH distro from recent years available.  I wanted the
> >2.4 kernel, because I understand its implementation of pthreads is
> >better, but am I choosing unwisely here?
> 
> The 2.4 kernel is better in every way, but has nothing really to do
> with pthreads. pthreads are user-space threads; in the linux
> implementation (or rather, the most common linux implementation), they
> happen to use a rather gorgeous linux system call called clone(2). but
> the kernel's handling of threads has not changed dramatically in quite
> some time now. 

No, pthreads are not userspace threads in Linux. Linux doesn't use
userspace threads because its context switches are fast enough to do it
in kernel.

There is actually no difference between processes and threads in Linux,
it's just a matter of what the two process entities want to share: the
clone() system call handles it all. You can call clone() directly, but
there are also two well known convenience functions build on top of it:
fork() and pthread_create(). Actually, in Linux the whole pthread
library is just a large wrapper around clone() and friends.


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2783635  Fax: +31-15-2781843  Email: J A K Mouw its tudelft nl
WWW: http://www-ict.its.tudelft.nl/~erik/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]