Well, yes, you are totally right... On Fri, Mar 6, 2009 at 6:45 AM, Greg Ewing <[email protected]> wrote: > Lisandro Dalcin wrote: > >> Supose you have a a pure C functions (I mean, no Py stuff), perhaps >> even declared 'with gil' in its signature... Now suppose that >> function access some global variables, then we would be able to get >> some sort of (global) locking using a 'with gil' block. Am I being >> clear? Do this make sense? Would this be useful? > > Hmmm... you'd be creating a third kind of state, as well > as 'gil held' and 'gil not held', there would be 'gil > held but you're still not allowed to mess with Python > stuff in this function'. Sounds a bit messy to me. > > It would be better to create an intermediate function > declared 'with gil' and call that from the nogil > function. Then the intermediate function will run > with the gil held. > > Also, I wouldn't like to build in a language feature > whose only purpose in life is to enable abusing the > gil for non-python purposes. A 'with gil' block ought > to deliver all that it seems to promise, or not be > there. > > -- > Greg > _______________________________________________ > Cython-dev mailing list > [email protected] > http://codespeak.net/mailman/listinfo/cython-dev >
-- Lisandro Dalcín --------------- Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC) Instituto de Desarrollo Tecnológico para la Industria Química (INTEC) Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET) PTLC - Güemes 3450, (3000) Santa Fe, Argentina Tel/Fax: +54-(0)342-451.1594 _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
