Open xin-jin opened 4 years ago
Why do you need a view? Can't you loop over each column by index, in each thread? Or have this function not take a Python object, but just a pointer to the data, or so? (I don't know how py::array
will interact with threads.) And what's the state of the GIL? Did you release it?
If things crash, have you managed to get a stack trace with gdb
?
Suppose I have a function that operates on a 1d array inplace
I now have a 2d array and I would like to implement a function (say, to do multi-threading) that calls
a
to operate on the 2d array columnwise. What is the correct way to do this?I did something like
But I sometimes got segmentation fault when num_threads is large, not sure why.