On Sat, Jun 21, 2008 at 12:28 PM, Stefan Behnel <[EMAIL PROTECTED]> wrote:
> Hi, > > rahul garg wrote: > > I was thinking of providing a "prange" which defaults to xrange when > running > > on interpreter. > > The reason I like the prange construct, is that we can easily add lets > say > > thread-local variables or reduction variables. > > for i in prange(i, threadlocal=[myvar1,myvar2],reduction=[red1,red2]): > #loop > > body > > You could easily do that with a > > with thread_each(iterable, threadlocal=...): > ... > > syntax, too, and IMHO it looks much better (minus a better name for > "thread_each" ;) > > And it might even be possible to support this in plain Python one day. Well the problem is that how does it run as a loop on the interpreter? If its to run as a loop on the interpreter, there must be a loop statement somewhere potentially. What about adopting it to : for i in thread_each(iterator,threadlocal=...): This is uglier than with thread_each() but has a simple serial implementation. Thoughts? thanks, rahul
_______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
