Strange array.array performance

Maxim Khitrov mkhitrov at gmail.com
Thu Feb 19 21:43:08 EST 2009


On Thu, Feb 19, 2009 at 9:34 PM, David Cournapeau <cournape at gmail.com> wrote:
> On Fri, Feb 20, 2009 at 4:53 AM, Maxim Khitrov <mkhitrov at gmail.com> wrote:
>> On Thu, Feb 19, 2009 at 2:35 PM, Robert Kern <robert.kern at gmail.com> wrote:
>>> On 2009-02-19 12:52, Maxim Khitrov wrote:
>>>>
>>>> Hello all,
>>>>
>>>> I'm currently writing a Python<->  MATLAB interface with ctypes and
>>>> array.array class, using which I'll need to push large amounts of data
>>>> to MATLAB.
>>>
>>> Have you taken a look at mlabwrap?
>>>
>>>  http://mlabwrap.sourceforge.net/
>>>
>>> At the very least, you will probably want to use numpy arrays instead of
>>> array.array.
>>>
>>>  http://numpy.scipy.org/
>>
>> I have, but numpy is not currently available for python 2.6, which is
>> what I need for some other features, and I'm trying to keep the
>> dependencies down in any case. Mlabwrap description doesn't mention if
>> it is thread-safe, and that's another one of my requirements.
>
> What do you mean by thread-safe ? Different threads calling the same
> matlab engine handle ?

Yes, I may have a case where one thread is still sending data, while
another tries to close the connection, or two threads trying to close
the connection at the same time. In both cases, I need some parts of
the code to be atomic to prevent errors.

- Max



More information about the Python-list mailing list