[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: User interaction from multiple threads

From: Tom Tromey
Subject: Re: User interaction from multiple threads
Date: Sat, 25 Aug 2018 10:16:06 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1.50 (gnu/linux)

>>>>> "Eli" == Eli Zaretskii <address@hidden> writes:

Tom> This was what I'd planned to do in the past but never got around to.  A
Tom> first step would be to make a new thread for each terminal and arrange
Tom> for the terminal's file descriptor to be thread-locked.  This didn't
Tom> seem very hard.  Once that's done I guess higher-level problems could be
Tom> looked into; I don't really know this area well though.

Eli> Please describe the proposed solution in more detail, because I'm not
Eli> sure I understand it.  By "new thread" do you mean a Lisp thread of
Eli> the kind made by make-thread, which will run only after it succeeds in
Eli> grabbing the global lock?  Or do you mean some other kind of thread?

Yes, the first step is to make a lisp thread for a new tty terminal, and
change init_tty and/or add_keyboard_wait_descriptor to thread-lock the
new file descriptor.  I don't know what comes after this, since I don't
know much about how the top level works.

I think the GIL doesn't matter much here (though I also think Emacs
should revisit the idea of periodic GIL releases) because waiting for
I/O releases it.  It seems to me that different terminals ought to be
independent, and if I'm, say, in the middle of entering a key sequence
in an X frame, that shouldn't block any sort of action in a tty frame.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]