[pypy-dev] FAQ entry

Yuriy Taraday yorik.sar at gmail.com
Wed Apr 8 10:47:52 CEST 2015


On Wed, Apr 8, 2015 at 10:16 AM Armin Rigo <arigo at tunes.org> wrote:

> Hi Yuriy,
>
> It seems that now you've understood the problems, so please re-read my
> previous answers :-)
>
> In particular, I try to give a situation where even what looks like a
> deadlock might not be one (because any thread can release any lock),
> and why we can't always run finalizers in a separate thread (because
> simple non-multithreaded programs don't expect concurrency when
> running dels).
>

I see problem with solution #1 since deadlock is hard to detect. It
actually is a workaround, so it won't work all the time and it's not a
prefered solution.
I still don't see problem with solution #2. I've been sent a link [0] to a
post that shows that signals and finalizers are "unexpected concurrency"
anyway. Furthermore even in multithreaded app we can't predict which thread
will end up executing them. So my argument is: why not make it clear that
__del__ will run in a separate thread instead of trying to pretend that
it's something more predictable than that?

[0] https://wingolog.org/archives/2012/02/16/unexpected-concurrency
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20150408/a1206a41/attachment.html>


More information about the pypy-dev mailing list