#143 Interruptible statistics code

Zusammengeführt
jens.klein hat 1 Commits von stefan.schmidt/stat_interrupt nach SPIN/master vor 6 Jahren zusammengeführt

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.
jens.klein hat vor 6 Jahren geschlossen
Dieser Pull-Request wurde erfolgreich zusammengeführt!
Anmelden, um an der Diskussion teilzunehmen.
Kein Meilenstein
Niemand zuständig
1 Beteiligte
Laden…
Abbrechen
Speichern
Hier gibt es bis jetzt noch keinen Inhalt.