Any resources about threading problems?

Mike Hearn mike at
Sat Mar 5 06:04:45 CST 2005

On Fri, 04 Mar 2005 08:52:44 -0800, Bill Medland wrote:
> 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)

We use it to mean that Wine is calling into libpthread for its threading
services. Because both NPTL and LinuxThreads provide the libpthread API,
they are both considered to be "pthread" implementations, even though Wine
can only actually use one of them (NPTL).

> 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.

It means we implement threading based on the underlying kernel thread
primitives (clone on linux), eg without the help of libpthread.
> We talk about overriding the native pthreads library.  Do we always
> override it or is it only wine-kthread that overrides it?  

Only wine-kthread overrides it. Wine-pthread uses the systems native
libpthread implementation.

> 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?

Yes, pretty much.

> (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)

In this context, "pthreads" refers to any implementation of the libpthread
API, even LinuxThreads. Feel free to make it clearer though ...

thanks -mike

More information about the wine-devel mailing list