Hacker News new | past | comments | ask | show | jobs | submit login

This is not true, you should never use spinlocks in userspace unless you know exactly what you're doing. Using spinlocks well requires scheduling, which you have no control over in userspace, this is why it makes more sense for kernel to use spinlocks. Without scheduling, with spinlocks, random threads can starve for no reason.



You are right, theoretically.

Unfortunately, the userspace part of pthreads is not tuned for performance and does a lot of ridiculous things if you care about parallelism.

(Mostly I was complaining about the poor quality of userspace system libraries.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: