#143 Interruptible statistics code

Слито
jens.klein слито 1 коммит(ов) из stefan.schmidt/stat_interrupt в SPIN/master 6 лет назад
Stefan Schmidt прокомментировал 6 лет назад

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 участников
Загрузка...
Отмена
Сохранить
Пока нет содержимого.