开发者

Is udev thread-safe?

开发者 https://www.devze.com 2022-12-28 18:54 出处:网络
I\'d like to know if there are dangers with spawning multiple threads that each create their own udev context and start monitoring hardware changes. It would think tha开发者_如何学JAVAt if each thread

I'd like to know if there are dangers with spawning multiple threads that each create their own udev context and start monitoring hardware changes. It would think tha开发者_如何学JAVAt if each thread has its own udev context everything is fine. However, if calls like udev_new or udev_monitor_new_from_netlink would access global/static variables then issues may arise.

Since neither the README or the documentation mentions anything about multithreading I'm asking it here. Does anyknow know something more?


A quick inspection of the udev source suggests that no static/global storage is used, everything appears to be tied to context.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号