On 5 April 2011 22:29, Dag Sverre Seljebotn <d.s.seljeb...@astro.uio.no> wrote: > I've done a pretty major revision to the prange CEP, bringing in a lot of > the feedback. > > Thread-private variables are now split in two cases: > > i) The safe cases, which really require very little technical knowledge -> > automatically inferred > > ii) As an advanced feature, unsafe cases that requires some knowledge of > threading -> must be explicitly declared > > I think this split simplifies things a great deal.
Can't we obsolete the declaration entirely by assigning to variables that need to have firstprivate behaviour inside the with parallel block? Basically in the same way the scratch space is used. The only problem with that is that it won't be lastprivate, so the value will be undefined after the parallel block (but not after the worksharing loop). cdef int myvariable with nogil, parallel: myvariable = 2 for i in prange(...): use myvariable maybe assign to myvariable # myvariable is well-defined here # myvariable is not well-defined here If you still desperately want lastprivate behaviour you can simply assign myvariable to another variable in the loop body. > I'm rather excited over this now; this could turn out to be a really > user-friendly and safe feature that would not only allow us to support > OpenMP-like threading, but be more convenient to use in a range of common > cases. > > http://wiki.cython.org/enhancements/prange > > Dag Sverre > > _______________________________________________ > cython-devel mailing list > cython-devel@python.org > http://mail.python.org/mailman/listinfo/cython-devel > > _______________________________________________ cython-devel mailing list cython-devel@python.org http://mail.python.org/mailman/listinfo/cython-devel