I don't think that it's going to be easy to get an "interrupt" working on windows. This code:
#include <Windows.h>
#include <R.h>
void test() {
for (int i = 0; i < 10; ++i) {
Rprintf("hello %d\n", i);
if (i == 4) {
GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0);
}
R_CheckUserInterrupt();
}
}
Will correctly stop the loop after the 5th iteration but will then terminate the R process (within Rterm) and leave the console in an unusable state. Run from within Rgui, nothing happens.
So that leaves us with the ability to kill workers only.
I don't think that it's going to be easy to get an "interrupt" working on windows. This code:
Will correctly stop the loop after the 5th iteration but will then terminate the R process (within Rterm) and leave the console in an unusable state. Run from within Rgui, nothing happens.
So that leaves us with the ability to kill workers only.