5

I tried udev as recommended (udevadm monitor). The VGA-Plug is reported after approx. two seconds. If I poll it, the change is reported almost instantly. What happens here?

Reactormonk
  • 21,472
  • 14
  • 74
  • 123

1 Answers1

3

If the polling was constant there would be much wasted CPU time, and the event timing would be skewed in the log output. When you manually poll, its occurring instantly, no timeout.

Geoffrey
  • 10,843
  • 3
  • 33
  • 46
  • So udev does polling itself, instead of subscription? – Reactormonk Jun 04 '11 at 10:36
  • 2
    udev must poll - modules don't make their own device nodes on the filesystem, so udev has to watch the list of loaded modules - detect when a supported module has been loaded, execute the rules associated with it, then create the device. – synthesizerpatel Jun 07 '11 at 10:37
  • @synthesizerpatel - Then how does udev detect new devices when the module has already been loaded? (ie: Multiple USB HID devices). udev subscribes to events from the kernel, there is no polling going on here. To constantly poll would be a terrible design and would cause longer then needed latency when new devices are connected. – Geoffrey Jul 16 '13 at 21:02