Any resources about threading problems?

Bill Medland billmedland at
Fri Mar 4 10:52:44 CST 2005

On February 23, 2005 10:41 am, Mike Hearn wrote:
> On Wed, 23 Feb 2005 09:30:50 -0800, Bill Medland wrote:
> > Does anyone know any site or book or something with a decent discussion
> > about the problems of the different threading models and their
> > implementations?
> That'd be the developers guide ;)

Yes, it looks like it is on the way to becoming a canonical reference

> > In the Developer's Guide in section 8.3 there are references to "the
> > threading chapter".  Is this a section that has not yet been written?
> It was written, and then the developer guide was reorganised and a ton of
> content was moved around. It's now under "NTDLL", which IMHO isn't very
> intuitive but I didn't reorganise it so I would say that :)
> > As I understand it we (in the pthreads version) "override the native
> > pthreads library".  What does this mean?
> It's explained at the above URL.
> thanks -mike

OK.  So I've spent over a week mulling over all this and I think I am 
beginning to see the light, but I find our  description confusing, primarily 
due to confusion over terminology.  I'd like to tighten it up and so I would 
appreciate it if someone who knows this stuff can confirm I have understood 
it correctly.

The source of a lot of my confusion is terminology.

pthread (or occasionally Pthread) is more normally used as a short name for 
the Pthreads section of the POSIX standard, and is therefore a specification, 
not an implementation.  We frequently use it to mean both the specification 
and any implementation that correctly implements the specification (such as 
the NPTL and not Linuxthreads)

kthread has many meanings.  It is sometimes a short name for a kernel thread 
(an object in the kernel).  Sometimes it refers to a simple threading package 
with a very non-pthreads api, used in various computer science classes around 
the world.  I still don't understand what it means in our documentation, but 
I presume it means LinuxThreads, LWP or any other threading implementation 
that does not correctly implement the pthread api.

NPTL (Native POSIX Thread Library for Linux) is an implementation of the 
pthread interface for the Linux operating system.  It is the replacement for 
Linuxthreads and is designed so that it can conform to the standard, 
especially in areas where Linuxthreads does not.

Linuxthreads is "a simple clone()-based implementation of Posix threads for 
Linux".  However, being simple, it fails to conforn to the standard in 
several areas.  Major packages have worked around these failures in the past.

LWP is (for us) the lightweight process library, a library handling 
multithreading primarily on SunOS, through its own api.  This is not actually 
relevant to our high-level description.

We talk about overriding the native pthreads library.  Do we always override 
it or is it only wine-kthread that overrides it?  My understanding is that if 
the underlying pthreads implementation correctly implements pthreads then it 
is not overridden; we only override it if the pthreads implementation is 
incorrect (e.g. if the implementation is Linuxthreads), and it only does so 
for the wine processes.

Is that all correct?

(Then there's the whole question of when pthreads means the pthreads 
specification, when it means the Linuxthreads implementation and when it 
means the NPTL implementation.  If I have the above correct then I can patch 
up and people can review the patch)

Bill Medland
mailto:billmedland at

More information about the wine-devel mailing list