Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Completely remove npth and all associated code. #14

Merged
merged 1 commit into from
Dec 1, 2017
Merged

Conversation

lambdafu
Copy link
Collaborator

@lambdafu lambdafu commented Dec 1, 2017

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.

@lambdafu lambdafu merged commit 960fe02 into master Dec 1, 2017
@lambdafu lambdafu deleted the npth-cleanup branch December 1, 2017 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant