eunomia-bpf/bpftime

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

hp77-creator opened this issue · 3 comments

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

Relates to #175

@Officeyutong this can be closed after #175 right?

@Officeyutong this can be closed after #175 right?

Sure