search for: threaded_fun

Displaying 4 results from an estimated 4 matches for "threaded_fun".

2019 May 19
4
most robust way to call R API functions from a secondary thread
...Rf_onintr(); return R_NilValue; } // function called by R_UnwindProtect() to cleanup on interrupt void cleanfun(void *data, Rboolean jump) { if (jump) { // terminate threads cleanly ... } } void fun_calling_R_API(void *data) { // call some R API function, e.g. mkCharCE() ... } void *threaded_fun(void *td) { // ... pthread_mutex_lock(&r_api_mutex); // avoid false stack overflow error: intptr_t R_CStackLimit_old = R_CStackLimit; R_CStackLimit = -1; // R_ToplevelExec() below will call PROTECT 4x: if (R_PPStackTop > R_PPStackSize - 4) { // ppstack would overflow i...
2019 May 20
1
most robust way to call R API functions from a secondary thread
...o cleanup on interrupt >> void cleanfun(void *data, Rboolean jump) { >> if (jump) { >> // terminate threads cleanly ... >> } >> } >> void fun_calling_R_API(void *data) { >> // call some R API function, e.g. mkCharCE() ... >> } >> void *threaded_fun(void *td) { >> // ... >> pthread_mutex_lock(&r_api_mutex); >> // avoid false stack overflow error: >> intptr_t R_CStackLimit_old = R_CStackLimit; >> R_CStackLimit = -1; >> // R_ToplevelExec() below will call PROTECT 4x: >> if (R_PPStackTop...
2019 May 20
0
[External] most robust way to call R API functions from a secondary thread
...called by R_UnwindProtect() to cleanup on interrupt > void cleanfun(void *data, Rboolean jump) { > if (jump) { > // terminate threads cleanly ... > } > } > > void fun_calling_R_API(void *data) { > // call some R API function, e.g. mkCharCE() ... > } > > void *threaded_fun(void *td) { > > // ... > > pthread_mutex_lock(&r_api_mutex); > > // avoid false stack overflow error: > intptr_t R_CStackLimit_old = R_CStackLimit; > R_CStackLimit = -1; > > > // R_ToplevelExec() below will call PROTECT 4x: > if (R_PPStackTop > R_PP...
2019 May 20
0
most robust way to call R API functions from a secondary thread
...R_UnwindProtect() to cleanup on interrupt > void cleanfun(void *data, Rboolean jump) { > if (jump) { > // terminate threads cleanly ... > } > } > > void fun_calling_R_API(void *data) { > // call some R API function, e.g. mkCharCE() ... > } > > void *threaded_fun(void *td) { > > // ... > > pthread_mutex_lock(&r_api_mutex); > > // avoid false stack overflow error: > intptr_t R_CStackLimit_old = R_CStackLimit; > R_CStackLimit = -1; > > > // R_ToplevelExec() below will call PROTECT 4x: > if (R_P...