[Stackless] atomic
Richard Tew
richard.m.tew at gmail.com
Tue Sep 16 00:20:32 CEST 2008
On Mon, Sep 15, 2008 at 5:44 PM, Alberto Ganesh Barbati
<AlbertoBarbati at libero.it> wrote:
> By the way, will stackless provide context manager for atomicity to be
> used in the "with" statement? I mean, wouldn't it be good to be able to
> write:
>
> with stackless.atomic():
> your_code_here()
>
> instead of:
>
> t = stackless.getcurrent()
> flag = t.set_atomic(True)
> try:
> your_code_here()
> finally:
> t.set_atomic(flag)
>
> I know it's not difficult for a user to write such a context manager,
> but it would be nice to have it provided by stackless itself.
'stackless' is a C extension module. This 'atomic' object would have
to be written in C. Not many people use the atomic features, as
indicated by the fact you're the first I have heard of in a long time.
We would be more than happy to provide a context manager, if you (or
anyone for that matter) provided patches to add it, given the patches
were of sufficient quality.
Cheers,
Richard.
More information about the Stackless
mailing list