Displaying 4 results from an estimated 4 matches for "integer_get_region".
2019 Mar 01
1
Surprising results from INTEGER_GET_REGION with ALTREP object
Dear Listmembers,
wanting to learn more about ALTREP I wrote the following function to
extract a subsequence from an integer vector:
#include <Rinternals.h>
SEXP integer_get_region(SEXP _x, SEXP _i, SEXP _n) {
int i = INTEGER(_i)[0];
int n = INTEGER(_n)[0];
SEXP result = PROTECT(Rf_allocVector(INTSXP, n));
INTEGER_GET_REGION(_x, i, n, INTEGER(result));
UNPROTECT(1);
return result;
}
For "shorter" vectors, the result is as expected:
> dyn.load("...
2020 Sep 13
2
Thread-safe R functions
Hi,
I am curious about whether there exist thread-safe functions in
`Rinternals.h`. I know that R is single-threaded designed, but for the
simple and straightforward functions like `DATAPTR` and `INTEGER_GET_REGION`,
are these functions safe to call in a multi-thread environment?
Best,
Jiefei
[[alternative HTML version deleted]]
2020 Sep 13
1
[External] Thread-safe R functions
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
longer) be thought of as being guaranteed to be essentially bare metal data
retrieval from memory.
Best,
~G
On Sun, Sep 13, 2020...
2020 Sep 13
0
[External] Thread-safe R functions
...ontext in your thread.
Best,
luke
On Sun, 13 Sep 2020, Jiefei Wang wrote:
> Hi,
>
> I am curious about whether there exist thread-safe functions in
> `Rinternals.h`. I know that R is single-threaded designed, but for the
> simple and straightforward functions like `DATAPTR` and `INTEGER_GET_REGION`,
> are these functions safe to call in a multi-thread environment?
>
> Best,
> Jiefei
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
&...