On 22 September 2010 12:56, Stephane DROUARD <[email protected]> wrote:
>>
>> If you can confirm that this works, I think you solution (3) with my
>> fix (in case it is fine) is be better option, right?
>
> Yes it works fine.

Nice.

> It's a bit less efficient than what I proposed, as, when an error occurs:
>  - it restores the thread context before Pyx_CppExn2PyErr(),
>  - saves the thread context after Pyx_CppExn2PyErr(),
>  - restores it in the /*finally:*/ block.
> whereas what I proposed only restores once the context (before 
> Pyx_CppExn2PyErr(), skipped in the /*finally:*/ block).
>

Indeed (but only when an error occurs)... However, I'm a bit confused:
Is my added restore in the finally block actually necessary? Is you
original implementation correct if you do not restore in the finally
block?

>
> But do we have to really care of performance when an error occurs?
>

I do not advocate using exceptions for control flow (though I do it in
a few cases), so I do not care about performance in this case.


-- 
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to