eunomia-bpf / bpftime

Userspace eBPF runtime for fast Uprobe & Syscall hook & Extensions with LLVM JIT
https://eunomia.dev/bpftime/
MIT License
687 stars 68 forks source link

[FEATURE] Currently pthread_spinlock_t doesn't work on MacOS system #303

Open hp77-creator opened 1 month ago

hp77-creator commented 1 month ago

Is your feature request related to a problem? Please describe.

Trying to build and run bpftime gave above as an issue. It was recommending to use pthread_rwlock_t and pthread_mutex instead of pthread_spinlock_t. After discussion with @Officeyutong and @yunwei37 they suggested to write own spinlock implementation.

Describe the solution you'd like

Create your own spinlock implementation which works well with bpftime: https://medium.com/@joao_vaz/spin-lock-in-modern-c-with-atomics-memory-barriers-and-exponential-back-off-522798aca817

hp77-creator commented 1 month ago

Relates to #175