Re: [Cython] Calling gil-requiring function not allowed without gil

2011-08-20 Thread Robert Bradshaw
On Thu, Aug 18, 2011 at 11:35 PM, Dag Sverre Seljebotn wrote: > On 08/18/2011 09:27 PM, Robert Bradshaw wrote: >> >> On Wed, Aug 17, 2011 at 11:39 PM, Dag Sverre Seljebotn >>  wrote: >>> >>> On 08/17/2011 09:21 PM, Robert Bradshaw wrote: On Wed, Aug 17, 2011 at 11:46 AM, Dag Sverre Selj

Re: [Cython] Calling gil-requiring function not allowed without gil

2011-08-18 Thread Dag Sverre Seljebotn
On 08/18/2011 09:27 PM, Robert Bradshaw wrote: On Wed, Aug 17, 2011 at 11:39 PM, Dag Sverre Seljebotn wrote: On 08/17/2011 09:21 PM, Robert Bradshaw wrote: On Wed, Aug 17, 2011 at 11:46 AM, Dag Sverre Seljebotn wrote: On 08/17/2011 08:19 PM, Robert Bradshaw wrote: That's a nice idea.

Re: [Cython] Calling gil-requiring function not allowed without gil

2011-08-18 Thread Robert Bradshaw
On Thu, Aug 18, 2011 at 12:27 PM, Robert Bradshaw wrote: > On Wed, Aug 17, 2011 at 11:39 PM, Dag Sverre Seljebotn > wrote: >> On 08/17/2011 09:21 PM, Robert Bradshaw wrote: >>> >>> On Wed, Aug 17, 2011 at 11:46 AM, Dag Sverre Seljebotn >>>  wrote: On 08/17/2011 08:19 PM, Robert Bradsha

Re: [Cython] Calling gil-requiring function not allowed without gil

2011-08-18 Thread Robert Bradshaw
On Wed, Aug 17, 2011 at 11:39 PM, Dag Sverre Seljebotn wrote: > On 08/17/2011 09:21 PM, Robert Bradshaw wrote: >> >> On Wed, Aug 17, 2011 at 11:46 AM, Dag Sverre Seljebotn >>  wrote: >>> >>> On 08/17/2011 08:19 PM, Robert Bradshaw wrote: That's a nice idea. I have to admit that all thes

Re: [Cython] Calling gil-requiring function not allowed without gil

2011-08-18 Thread Dag Sverre Seljebotn
On 08/18/2011 09:06 AM, Stefan Behnel wrote: Dag Sverre Seljebotn, 18.08.2011 08:39: The semantics are simple: For all cdef functions, if "nogil" could have been applied without a syntax error, then it gets automatically applied. The only time this isn't completely safe is when the GIL is inten

Re: [Cython] Calling gil-requiring function not allowed without gil

2011-08-18 Thread Stefan Behnel
Dag Sverre Seljebotn, 18.08.2011 08:39: The semantics are simple: For all cdef functions, if "nogil" could have been applied without a syntax error, then it gets automatically applied. The only time this isn't completely safe is when the GIL is intentionally being used as a lock. In which case

Re: [Cython] Calling gil-requiring function not allowed without gil

2011-08-17 Thread Dag Sverre Seljebotn
On 08/18/2011 08:39 AM, Dag Sverre Seljebotn wrote: On 08/17/2011 09:21 PM, Robert Bradshaw wrote: On Wed, Aug 17, 2011 at 11:46 AM, Dag Sverre Seljebotn wrote: On 08/17/2011 08:19 PM, Robert Bradshaw wrote: That's a nice idea. I have to admit that all these special gil declarations are a bi

Re: [Cython] Calling gil-requiring function not allowed without gil

2011-08-17 Thread Stefan Behnel
Robert Bradshaw, 17.08.2011 20:19: I have to admit that all these special gil declarations are a bit messy. I'd also rather introduce clear decorators, e.g. @cython.requires_gil # expects gil cdef a(): ... @cython.requires.gil(False) # nogil cdef b(): ... @cython.aquires_gil # with gil cdef

Re: [Cython] Calling gil-requiring function not allowed without gil

2011-08-17 Thread Dag Sverre Seljebotn
On 08/17/2011 09:21 PM, Robert Bradshaw wrote: On Wed, Aug 17, 2011 at 11:46 AM, Dag Sverre Seljebotn wrote: On 08/17/2011 08:19 PM, Robert Bradshaw wrote: That's a nice idea. I have to admit that all these special gil declarations are a bit messy. I'd also rather introduce clear decorators,

Re: [Cython] Calling gil-requiring function not allowed without gil

2011-08-17 Thread Robert Bradshaw
On Wed, Aug 17, 2011 at 11:46 AM, Dag Sverre Seljebotn wrote: > On 08/17/2011 08:19 PM, Robert Bradshaw wrote: >> >> That's a nice idea. I have to admit that all these special gil >> declarations are a bit messy. I'd also rather introduce clear >> decorators, e.g. >> >> @cython.requires_gil  # exp

Re: [Cython] Calling gil-requiring function not allowed without gil

2011-08-17 Thread Dag Sverre Seljebotn
On 08/17/2011 08:19 PM, Robert Bradshaw wrote: That's a nice idea. I have to admit that all these special gil declarations are a bit messy. I'd also rather introduce clear decorators, e.g. @cython.requires_gil # expects gil cdef a(): ... @cython.requires.gil(False) # nogil cdef b(): ... @cyth

Re: [Cython] Calling gil-requiring function not allowed without gil

2011-08-17 Thread Robert Bradshaw
On Wed, Aug 17, 2011 at 1:08 AM, Dag Sverre Seljebotn wrote: > On 08/17/2011 09:12 AM, Robert Bradshaw wrote: >> So your proposal is that "with cython.synchronized" has the same >> effect as a Python operation, in that its a compile time error to do >> it while not holding the gil? (As opposed to

Re: [Cython] Calling gil-requiring function not allowed without gil

2011-08-17 Thread Dag Sverre Seljebotn
On 08/17/2011 09:12 AM, Robert Bradshaw wrote: On Fri, Aug 12, 2011 at 6:13 AM, Dag Sverre Seljebotn wrote: On 08/12/2011 02:45 PM, Stefan Behnel wrote: [second try in moving this discussion to cython-devel] Dag Sverre Seljebotn, 12.08.2011 08:50: On 08/12/2011 06:44 AM, Robert Bradshaw wro