[Chennaipy] Mutli- threading in cython
aishwarya selvaraj
aishwaryaselvaraj1708 at gmail.com
Tue May 22 02:28:14 EDT 2018
Hi,
Thank you for the suggestion. I was trying out an example code using
PyArray_NewFromDescr*.* PFA of the code.I compiled the file using :python
setup.py build_ext --inplace.
When compiled I get the following error :
fatal error : numpy/arrayobject.h :No such file or directory.
I would be realy gratefull if you could do the edit in the file I sent in
my first mail.
ᐧ
On Mon, May 21, 2018 at 9:19 PM, Aravindhan K <aravindhank1994 at gmail.com>
wrote:
> Hi,
>
> You could try using PyArray_NewFromDescr NumPy C-API function for
> creating nd-array
> in function capturing frames.
> than doing nested loops to do copy byte by byte. (This could be the
> bottleneck)
> https://docs.scipy.org/doc/numpy-1.14.0/reference/c-api.
> array.html#from-scratch
>
>
> Regards,
> Aravindhan K
>
> On Mon, May 21, 2018 at 5:12 PM, aishwarya selvaraj <
> aishwaryaselvaraj1708 at gmail.com> wrote:
>
>> Dear all,
>> I was programming for Andor CCD using SDK libraries in python using
>> cython.
>> I have a piece of code within my .pyx script which does the function of
>> storing the data into a 3D array. While acquiring n frames, each of them is
>> stored in a 3D array named data, which later I would be displaying. But
>> this creates a bottleneck in my code.
>> Hence I need to introduce threading, such that for each frame to be
>> stored there are individual threads for the same and the frames could be
>> displayed simultaneously without creating a performance lag.
>> Since I have never worked on multithreading, could anyone please help me.
>> PFA of the code. (LiveAcquisition code)
>>
>>
>> --
>> Regards,
>> Aishwarya Selvaraj
>>
>> _______________________________________________
>> Chennaipy mailing list
>> Chennaipy at python.org
>> https://mail.python.org/mailman/listinfo/chennaipy
>>
>>
>
> _______________________________________________
> Chennaipy mailing list
> Chennaipy at python.org
> https://mail.python.org/mailman/listinfo/chennaipy
>
>
--
Regards,
Aishwarya Selvaraj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chennaipy/attachments/20180522/e901ebd1/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stackarray.pyx
Type: application/octet-stream
Size: 569 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/chennaipy/attachments/20180522/e901ebd1/attachment.obj>
More information about the Chennaipy
mailing list