[Top][All Lists]

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

Re: Can we go GTK-only?

From: Ken Raeburn
Subject: Re: Can we go GTK-only?
Date: Mon, 31 Oct 2016 14:22:50 -0400

On Oct 31, 2016, at 11:54, Eli Zaretskii <address@hidden> wrote:

>   One problem with
> having too much code in separate threads is that only the main thread
> can call malloc/free, i.e. you cannot create/destroy objects in other
> threads.

Wow.  Is that a Windows limitation?  It’s certainly not true under POSIX 

Creating Lisp objects, that’d be another matter, unless locking is introduced 
to the allocator.

>  Another problem is calling QUIT: you need to switch to the
> main thread before you do that, or else you will crash.

Yes, quit checking, generation, and inhibition would all need to be reviewed.

>  And there are
> probably other limitations.

Probably.  I doubt any are insurmountable.

> The w32 build uses a separate thread for receiving the window-system
> events, so you might look there for some ideas that won't blow up the
> basic MVC design of Emacs.  In a nutshell, the events received by the
> w32 input thread are pushed onto a queue which is serviced by an
> emulation of a socket-read hook, called from keyboard.c, like all the
> other such hooks.

Seems like a good place to start.

> Of course, this doesn't help when the main thread is busy doing
> something prolonged, because it then doesn't get to processing the
> input events.

Yeah, in cases like that it’d be no better than today.


reply via email to

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