bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#53877: 29.0.50; [PATCH] async Gnus/nnml


From: Eric Abrahamsen
Subject: bug#53877: 29.0.50; [PATCH] async Gnus/nnml
Date: Thu, 10 Feb 2022 12:37:40 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Eric Abrahamsen <eric@ericabrahamsen.net>
>> Date: Thu, 10 Feb 2022 10:11:56 -0800
>> Cc: 53877@debbugs.gnu.org, Lars Ingebrigtsen <larsi@gnus.org>
>> 
>> 
>> (defun test-threads-outer ()
>>   (dolist (label (list "one" "two" "three"))
>>     (make-thread (lambda () (test-threads-inner label)) label)))
>> 
>> (defun test-threads-inner (label)
>>   (let ((nnmail-article-buffer (format "nnmail-incoming-%s" label)))
>>     (with-current-buffer (get-buffer-create nnmail-article-buffer)
>>       (insert label))))
>> 
>> That creates three separate buffers, named correctly, and holding the
>> correct text.
>
> But only if you don't do anything in the main thread, just let it sit
> idling.  Right?  Otherwise those other threads won't get an
> opportunity to run.

Sure, in real life we'd be yielding to these threads and joining
afterwards before going on with the rest of the code. This example was
just to show that having different locally-bound values for
`nnmail-article-buffer' in each thread was a viable approach.





reply via email to

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