mrc-ide / heartbeatr

:heartpulse::computer::heartpulse: Redis heartbeat support
https://mrc-ide.github.io/heartbeatr
Other
2 stars 1 forks source link

Get working on Windows #8

Closed richfitz closed 7 years ago

richfitz commented 7 years ago

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.

richfitz commented 7 years ago

Working on windows now. The interrupt does not work, but we should be able to send termination anyway