Search code examples
linuxmultithreadingudev

Is udev thread-safe?


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 that 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?


Solution

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