Skip to content

Instantly share code, notes, and snippets.

@supermartian
Created October 1, 2015 18:59
Show Gist options
  • Save supermartian/207b3b0ec81f56da6b8e to your computer and use it in GitHub Desktop.
Save supermartian/207b3b0ec81f56da6b8e to your computer and use it in GitHub Desktop.
pthread_mutex_lock
pthread mutex lock comes with different types:
1. private: process only
2. shared: cross the process boundary
Private:
Spins in the userspace for a while, after a timeout, goes to futex. In this way it saves some system calls.
Shared:
Goes to futex directly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment