Clean up threading code some more

This commit is contained in:
Justine Tunney 2022-09-13 14:57:38 -07:00
parent 6a3330d7c9
commit 654ceaba7d
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
28 changed files with 119 additions and 134 deletions

View file

@ -25,6 +25,7 @@
#include "libc/intrin/kprintf.h"
#include "libc/intrin/weaken.h"
#include "libc/runtime/clone.internal.h"
#include "libc/runtime/internal.h"
#include "libc/runtime/runtime.h"
#include "libc/runtime/stack.h"
#include "libc/str/str.h"
@ -49,22 +50,6 @@
* they're wicked fast and free of bloat if your app is tiny.
*/
// RAW means without *NSYNC
// TLS means gettid() is fast
// PTHREAD_MUTEX_NORMAL RAW TLS took 6ns
// PTHREAD_MUTEX_RECURSIVE RAW TLS took 12ns
// PTHREAD_MUTEX_ERRORCHECK RAW TLS took 13ns
// PTHREAD_MUTEX_NORMAL RAW TLS contended took 16ns (!!)
// PTHREAD_MUTEX_RECURSIVE RAW TLS contended took 205ns
// PTHREAD_MUTEX_ERRORCHECK RAW TLS contended took 219ns
// PTHREAD_MUTEX_NORMAL RAW took 6ns
// PTHREAD_MUTEX_RECURSIVE RAW took 236ns
// PTHREAD_MUTEX_ERRORCHECK RAW took 233ns
// PTHREAD_MUTEX_NORMAL RAW contended took 20ns (!!)
// PTHREAD_MUTEX_RECURSIVE RAW contended took 421ns
// PTHREAD_MUTEX_ERRORCHECK RAW contended took 435ns
atomic_int ready;
atomic_int counter;
atomic_int success;