#143 Interruptible statistics code

已合并
jens.klein 6 年之前 将 1 次代码提交从 stefan.schmidt/stat_interrupt合并至 SPIN/master

This makes the statistics calculation code interruptible by CTRL+C by checking PyErr_CheckSignals() in all parts of the code that have the potential to take a significant amount of time, and, if it returns true, throwing py::error_already_set(). This is catched by pybind and makes Python see the "KeyboardInterrupt" exception.

In the main loop, PyErr_CheckSignals() is only checked once per second to minimize the performance impact, resulting in no measurable increase in runtime on my system.

This makes the statistics calculation code interruptible by CTRL+C by checking PyErr_CheckSignals() in all parts of the code that have the potential to take a significant amount of time, and, if it returns true, throwing py::error_already_set(). This is catched by pybind and makes Python see the "KeyboardInterrupt" exception. In the main loop, PyErr_CheckSignals() is only checked once per second to minimize the performance impact, resulting in no measurable increase in runtime on my system.
该合并请求已经成功合并!
登录 并参与到对话中。
未选择标签
Bug
未选择里程碑
未指派成员
1 名参与者
正在加载...
取消
保存
这个人很懒,什么都没留下。