[Numpy-discussion] Numpy arrays shareable among related processes (PR #7533)
Antoine Pitrou
solipsis at pitrou.net
Tue May 24 07:22:51 EDT 2016
On Thu, 12 May 2016 23:14:36 +0000 (UTC)
Sturla Molden <sturla.molden at gmail.com> wrote:
> Antoine Pitrou <solipsis at pitrou.net> wrote:
>
> > Can you define "expensive"?
>
> Slow enough to cause complaints on the Cython mailing list.
What kind of complaints? Please be specific.
> > Buffer acquisition itself only calls a single C callback and uses a
> > stack-allocated C structure. It shouldn't be "expensive".
>
> I don't know the reason, only that buffer acquisition from NumPy arrays
> with typed memoryviews
Again, what have memoryviews to do with it? "Acquiring a buffer" is
just asking the buffer provider (the Numpy array) to fill a Py_buffer
structure's contents. That has nothing to do with memoryviews.
When writing C code to interact with buffer-providing objects, you
usually don't bother with memoryviews at all. You just use a Py_buffer
structure.
Regards
Antoine.
More information about the NumPy-Discussion
mailing list