mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-22 04:50:07 +00:00
6a5d6ea128
We have a single thread that runs a no-op initialization once and then repeatedly runs checks of the initialization (i.e., an acquire load and conditional jump) in a tight loop. This gives us, on average, the best-case latency of pthread_once (the initialization is the exactly-once slow path, and we're not looking at initialization-related synchronization overheads in this case).
10 lines
434 B
Plaintext
10 lines
434 B
Plaintext
# This tests the common-case scenario for pthread_once.
|
|
# We have a single thread that runs a no-op initialization once and then
|
|
# repeatedly runs checks of the initialization (i.e., an acquire load and
|
|
# conditional jump) in a tight loop.
|
|
# scripts/bench.py doesn't handle function pointers, so we just use void *:
|
|
## args: pthread_once_t *:void *
|
|
## includes: pthread.h
|
|
## include-sources: pthread_once-source.c
|
|
&once, once_handler
|