<div dir="ltr">So I actually thought about similar approach. I was curious what do you think about approach to concurrency similar to what Apple did with C blocks and GCD. That is: enable threading but instead of the STM approach have fully explicit mutations within atomic blocks</div><div class="gmail_extra"><br><div class="gmail_quote">2016-06-20 16:53 GMT+02:00 Armin Rigo <span dir="ltr"><<a href="mailto:arigo@tunes.org" target="_blank">arigo@tunes.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Omer,<br>
<span class=""><br>
On 20 June 2016 at 08:51, Omer Katz <<a href="mailto:omer.drow@gmail.com">omer.drow@gmail.com</a>> wrote:<br>
> As for implementation, if we can trace the code running in the thread and<br>
> ensure it's not mutating global state and that CPyExt is never used during<br>
> the thread's course we can simply release the GIL when such a thread is run.<br>
<br>
</span>That's a very hand-wavy and vague description. To start with, how do<br>
you define exactly "not mutating global state"? We are not allowed to<br>
write to any of the objects that existed before we started the thread?<br>
It may be possible to have such an implementation, yes. Actually,<br>
that's probably easy: tweak the STM code to crash instead of doing<br>
something more complicated when we write to an old object.<br>
<br>
I'm not sure how useful that would be---or how useful PyParallel is on<br>
CPython. Maybe if you can point us to real usages of PyParallel it<br>
would be a start.<br>
<br>
<br>
A bientôt,<br>
<br>
Armin.<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
pypy-dev mailing list<br>
<a href="mailto:pypy-dev@python.org">pypy-dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/pypy-dev" rel="noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/pypy-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">---------------------------<div>Michał Domański</div></div>
</div>