Completely remove npth and all associated code. #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Npth is the GnuPG library for cooperative multithreading. It will ensure single-threaded operation most of the time, but allow concurrent threads to block on system calls. Unfortunately, this design has two major problems: All blocking system calls must be identified, including those hidden in library code, leading to very invasive code changes all throughout the stack (syscall clamps). On the other hand, the more blocking system calls are identified (and "clamped" by releasing the global lock), the more actual concurrency can occur. This leads to subtle race conditions, which have to be fixed by proper locking just as in a preemptive multithreaded design. Ultimately, this defeats the whole purpose of the initial idea.
Because we have already removed the daemon modes of the various components, and aim for a library with a single-process design, most needs for concurrency have already eliminated. For clarity, this pull request preserves the locking (using std::mutex), although it probably isn't needed anymore.