Beginner questions about npth

NIIBE Yutaka gniibe at
Tue Sep 1 07:50:06 CEST 2015


nPth is a library of cooperative threads programming on top of system
thread library.  "Cooperative" means that only single thread can run.
This condition simplifies things around mutual exclusion control and
shared resource.

On 09/01/2015 12:10 PM, drichd at wrote:
> - How can I utilize multiple cores when I want several 
>   threads to run on different cpu?

You can't with nPth (by its design).  Please use system thread

> - Is npth implemented with call/cc?

No.  It is implemented on top of system thread library.

It seems that you are confused.  In an execution model where call/cc
is valid, execution can proceed like tree, while it goes just
up-and-down in an execution model with stack.  Well, it would be
possible to emulate call/cc with cooperative threads (or vice versa),
but it wouldn't be so cheap or recommended.

More information about the Gnupg-devel mailing list