Re: [Cython] Acquisition counted cdef classes

2011-10-24 Thread Robert Bradshaw
On Mon, Oct 24, 2011 at 2:52 PM, mark florisson wrote: > On 24 October 2011 22:03, Greg Ewing wrote: >> mark florisson wrote: >>> >>> These will by default not lock for operations to allow >>> e.g. one thread to iterate over the list and another thread to index >>> it without lock contention and

Re: [Cython] Acquisition counted cdef classes

2011-10-24 Thread mark florisson
On 24 October 2011 22:03, Greg Ewing wrote: > mark florisson wrote: >> >> These will by default not lock for operations to allow >> e.g. one thread to iterate over the list and another thread to index >> it without lock contention and other general overhead. > > I don't think that's safe. You can'

Re: [Cython] Acquisition counted cdef classes

2011-10-24 Thread mark florisson
On 24 October 2011 22:03, Greg Ewing wrote: > mark florisson wrote: >> >> These will by default not lock for operations to allow >> e.g. one thread to iterate over the list and another thread to index >> it without lock contention and other general overhead. > > I don't think that's safe. You can'

Re: [Cython] Buffer interface to boolean arrays with cast=True on Python 2.5 failing

2011-10-24 Thread Wes McKinney
On Mon, Oct 24, 2011 at 4:09 PM, Dag Sverre Seljebotn wrote: > On 10/24/2011 09:40 PM, Wes McKinney wrote: >> >> On Mon, Oct 24, 2011 at 3:37 PM, Dag Sverre Seljebotn >>  wrote: >>> >>> On 10/24/2011 09:26 PM, Wes McKinney wrote: I've been using ndarray[uint8_t, cast=True] boo

Re: [Cython] Acquisition counted cdef classes

2011-10-24 Thread Greg Ewing
mark florisson wrote: These will by default not lock for operations to allow e.g. one thread to iterate over the list and another thread to index it without lock contention and other general overhead. I don't think that's safe. You can't say "I'm not modifying this, so I don't need to lock it"

Re: [Cython] Buffer interface to boolean arrays with cast=True on Python 2.5 failing

2011-10-24 Thread Dag Sverre Seljebotn
On 10/24/2011 09:40 PM, Wes McKinney wrote: On Mon, Oct 24, 2011 at 3:37 PM, Dag Sverre Seljebotn wrote: On 10/24/2011 09:26 PM, Wes McKinney wrote: I've been using ndarray[uint8_t, cast=True] bool_arr to work with dtype=bool arrays in Cython lately. When testing using Python 2.5 / NumPy 1

[Cython] Acquisition counted cdef classes

2011-10-24 Thread mark florisson
Hey, This is in response to http://groups.google.com/group/cython-users/browse_thread/thread/bcbc5fe0e329224f and http://trac.cython.org/cython_trac/ticket/498 , and some of the previous discussion on cython.parallel. Basically I think we should have something more powerful than 'cdef borrowed Cd

Re: [Cython] Buffer interface to boolean arrays with cast=True on Python 2.5 failing

2011-10-24 Thread Wes McKinney
On Mon, Oct 24, 2011 at 2:40 PM, Wes McKinney wrote: > On Mon, Oct 24, 2011 at 3:37 PM, Dag Sverre Seljebotn > wrote: >> On 10/24/2011 09:26 PM, Wes McKinney wrote: >>> >>> I've been using >>> >>> ndarray[uint8_t, cast=True] bool_arr >>> >>> to work with dtype=bool arrays in Cython lately. When t

Re: [Cython] Buffer interface to boolean arrays with cast=True on Python 2.5 failing

2011-10-24 Thread Wes McKinney
On Mon, Oct 24, 2011 at 3:37 PM, Dag Sverre Seljebotn wrote: > On 10/24/2011 09:26 PM, Wes McKinney wrote: >> >> I've been using >> >> ndarray[uint8_t, cast=True] bool_arr >> >> to work with dtype=bool arrays in Cython lately. When testing using >> Python 2.5 / NumPy 1.6.1 on Windows, I'm getting

Re: [Cython] Buffer interface to boolean arrays with cast=True on Python 2.5 failing

2011-10-24 Thread Dag Sverre Seljebotn
On 10/24/2011 09:26 PM, Wes McKinney wrote: I've been using ndarray[uint8_t, cast=True] bool_arr to work with dtype=bool arrays in Cython lately. When testing using Python 2.5 / NumPy 1.6.1 on Windows, I'm getting "unknown dtype code in numpy.pxd (0)". Everything works fine with Python 2.6/2.7

[Cython] Buffer interface to boolean arrays with cast=True on Python 2.5 failing

2011-10-24 Thread Wes McKinney
I've been using ndarray[uint8_t, cast=True] bool_arr to work with dtype=bool arrays in Cython lately. When testing using Python 2.5 / NumPy 1.6.1 on Windows, I'm getting "unknown dtype code in numpy.pxd (0)". Everything works fine with Python 2.6/2.7 and NumPy 1.6.1. This is with Cython 0.15.1.