[Top][All Lists]

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

Re: "concurrency" branch updated

From: Elias Mårtenson
Subject: Re: "concurrency" branch updated
Date: Tue, 3 Nov 2015 11:58:19 +0800

I started playing around with this branch a bit and I quickly discovered an issue. I wanted to take the opportunity of describing this issue while at the same time hopefully gain some insight into the design of the feature.

What I did was to write the following function:

    (defun foo ()
      (loop for i from 0 below 10
            do (message (format "Message %d" i))
            do (sit-for 1)))

I then started this function in a thread:

    (make-thread #'foo)

What happened was that the 10 messages were printed to the *Messages* buffer without any delay between them, and then the entire Emacs session became incredibly sluggish.

Looking at the implementation of sit-for, it seems as though it ends up calling read-event on a different thread which is probably not a good idea. Is this a correct assessment?


On 3 November 2015 at 05:57, John Wiegley <address@hidden> wrote:
>>>>> Eli Zaretskii <address@hidden> writes:

> you will find among the changes a section for the ELisp manual that
> describes the features on the Lisp level. After that, src/thread.c,
> src/systhread.c, and the rest of the C-level changes, for the gory details.

> Have fun!

Thanks, Eli!  I will read through those carefully.


reply via email to

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