Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 wxPython 应用程序,它使用 pyinotify(通过 ThreadedNotifier)来检查某个文件何时被修改。发生这种情况时,应用程序会停止查看文件并执行一些操作。一切正常,除了对 ThreadedNotifier.stop() 的调用通常需要相当长的时间,大约 4 秒......其他时候,它会立即退出。 还有其他人经历过吗?这是预期的吗?
(Xubuntu 9.04)
莫非是一个超时4秒左右的轮询机制?并且线程只有在进入 run() 阶段时才真正停止?
这可能与线程库有关。
您可以通过使用具有不同超时的通知器来测试它。