Next steps in PyPy investigations

Yuya Nishihara yuya at tcha.org
Thu Feb 11 22:18:26 EST 2016


On Thu, 11 Feb 2016 16:42:22 -0800, Bryan O'Sullivan wrote:
> On Thu, Feb 11, 2016 at 1:36 PM, Sean Farley <sean at farley.io> wrote:
> > This is all really, really awesome. Yuya demoed an example of this at
> > the London sprint but warned that the forking model would need to be
> > different. Do you think that will be hard to accomplish this go-round?

That was old pre-forking version. I ran "hg log -Tdefault > /dev/null" on it.
Because templater runs bunch of Python codes repeatedly, that was the example
which must go better on PyPy.

> On the simplest level, tweaking chg to use threads instead of forking is
> just a one-liner. Beyond that, there'll be presumably a lot of details to
> work out around getting threading to actually work right, mostly around
> accidental use of what will under this model become shared mutable state.

Threads won't work well with signals. And I think we can't terminate stalled
blocking recv() without a signal.

> These are problems that I think TortoiseHG doesn't run into because its UI
> can enforce a single operation at a time, whereas hg hidden behind chg has
> to remain responsive and work correctly if you're running two operations
> concurrently in different terminals.

TortoiseHg spawns a command server per repository. I'm trying to move more
Mercurial stuff to the command process because there have been several thread
issues, and multithreading is difficult for me.


More information about the Mercurial-devel mailing list