Re: [Rd] [External] Thread-safe R functions

2020-09-14 Thread Jiefei Wang
Thanks, Gabriel and Luke. That is exactly what I would like to know. I appreciate your suggestions. Best, Jiefei On Mon, Sep 14, 2020 at 6:08 AM Gabriel Becker wrote: > Jiefei, > > Beyond the general response that Luke gave, to be a bit more specific to > what you said, DATAPTR and

Re: [Rd] [External] Thread-safe R functions

2020-09-13 Thread Gabriel Becker
Jiefei, Beyond the general response that Luke gave, to be a bit more specific to what you said, DATAPTR and INTEGER_GET_REGION involve ALTREP method execution (for ALTREP objects, obviously) so even they are not as simple and straightforward as they were a couple years ago. They should not (any

Re: [Rd] [External] Thread-safe R functions

2020-09-13 Thread luke-tierney
You should assume that NO functions or macros in the R API are thread-safe. If some happen to be now, on some platforms, they are not guaranteed to be in the future. Even if you use a global lock you need to keep in mind that any function in the R API can signal an error and execute a longjmp,