emacs-devel
[Top][All Lists]
Advanced

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

Re: System calls without error checks in w32


From: Lennart Borgman
Subject: Re: System calls without error checks in w32
Date: Tue, 8 Jun 2010 02:32:28 +0200

On Mon, Jun 7, 2010 at 8:54 PM, grischka <address@hidden> wrote:
> Lennart Borgman wrote:
>>
>> On Mon, Jun 7, 2010 at 7:21 PM, grischka <address@hidden> wrote:
>>>
>>> Lennart Borgman wrote:
>>>>
>>>> I guess the idea of having two event loops/thread is not in itself
>>>> bad. If the gui thread is never blocked it can be used to convey
>>>> status information at least to the user. (You can put these in
>>>> temporary windows inside the frame for example.)
>>
>>> Since this is Emacs you'd probably want to format your status info
>>> in Lisp.  Bye nice idea and welcome to thread hell.
>>
>> I see no reason to format it in Lisp. Or rather my idea is that the
>> status information is formated by the lisp thread in advance and sent
>> to the gui thread in a non-lisp format. Then the gui thread can offer
>> that information without contactinog the lisp thread.
>
> But then what is the benefit from that additional effort of preparing
> and sending a "non-lisp" representation forth and back, except to satisfy
> the requirements of having two threads?  Have only one thread and you
> can format and display the info in one go.  Simple, reliable, conclusive.


I suppose the rational for having two threads is that basic gui
operations should not be stalled by lisp computations. I do not know
how it is actually implemented now in Emacs but with two threads you
can post messages between them to coordinate them without interrupting
the gui handling badly. Here is an example:

- the user resize the frame during a lisp computation. The resizing
happens then entirely in the gui thread.

- When resizing is finished the gui thread can send a message telling
that to the lisp queue.

- The lisp queue can then handle this when it has time to do that and
ask the system for the new frame size.

- The gui thread can also send resizing messages during resizing which
the lisp thread can safely ignore if it is occupied since the
information is available later.
The gui thread can send a message to the lisp thread when resizing is
finished and tell that resizing has been done. The



reply via email to

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