[Cython] cython.parallel tasks, single, master, critical, barriers

Jon Olav Vik jonovik at gmail.com
Sun Oct 9 22:48:49 CEST 2011

On Sun, Oct 9, 2011 at 9:01 PM, mark florisson
<markflorisson88 at gmail.com> wrote:
> On 9 October 2011 19:54, Jon Olav Vik <jonovik at gmail.com> wrote:
>> Personally, I think I'd prefer context managers as a very
>> readable way to deal with parallelism
> Yeah it makes a lot of sense for mutual exclusion, but 'master' really
> means "only the master thread executes this peace of code, even though
> other threads encounter the same code", which is more akin to 'if'
> than 'with'.

I see your point. However, another similarity with "with" statements
as an encapsulated "try..finally" is when there's a barrier at the end
of the block. I can live with some magic if it saves me from having a
boilerplate line of "barrier" everywhere 8-)

More information about the cython-devel mailing list