How does a threading.Thread yield the rest of its quantum in Python?

后端 未结 3 1657
深忆病人
深忆病人 2020-12-08 01:53

I\'ve got a thread that\'s polling a piece of hardware.

while not hardware_is_ready():
    pass
process_data_from_hardware()

But there are

3条回答
  •  天命终不由人
    2020-12-08 02:42

    If you're doing this on *nix, you might find the select library useful. Kamaela also has a few components you may find useful, but it may require a bit of a paradigm change.

提交回复
热议问题