[Qt-interest] Threads

Thiago Macieira thiago at kde.org
Wed Jun 23 08:24:37 CEST 2010


Em Quarta-feira 23. Junho 2010, às 06.38.53, Mandeep Sandhu escreveu:
> >> Doh!  That's not quite right... but it's usually right.
> >> 
> >> pthreads is POSIX, and somewhat implementation independent.
> >> 
> >> The threads are supplied with your libc.  Most these days are shipping
> >> NPTL.  NPTL is kernel threads.  LinuxThreads is user-space threads
> >> (IIRC).  Most every distro is using NPTL these days.
> 
> IMO, NPTL != kernel threads.
> 
> In Linux each thread is directly seen by the kernel as a schedulable
> entity. But threads are still run in user space unlike linux kernel
> threads which run in the kernel context.

That is correct. But that might not be the distinction that the OP was going 
after.

Kernel threads are those which the kernel itself schedules. Like you said 
yourself, each thread in Linux is directly scheduled by the kernel, so they 
are kernel threads.

User threads are those in which the userspace does the scheduling, usually in-
process and cooperative. At one point, the userspace code decides to context-
switch on its own to another thread and resume executing it.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100623/8d296da6/attachment.bin 


More information about the Qt-interest-old mailing list