unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 53877@debbugs.gnu.org, larsi@gnus.org, manuel@ledu-giraud.fr
Subject: bug#53877: 29.0.50; [PATCH] async Gnus/nnml
Date: Thu, 10 Feb 2022 12:37:40 -0800	[thread overview]
Message-ID: <87sfsq8nl7.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <837da2tqof.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 10 Feb 2022 22:25:20 +0200")

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	other threads:[~2022-02-10 20:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 14:22 bug#53877: 29.0.50; [PATCH] async Gnus/nnml Manuel Giraud
2022-02-08 20:33 ` Eric Abrahamsen
2022-02-09  9:00   ` Robert Pluim
2022-02-09  8:15 ` Lars Ingebrigtsen
2022-02-09  9:42   ` Manuel Giraud
2022-02-09  9:51     ` Lars Ingebrigtsen
2022-02-09 10:39       ` Manuel Giraud
2022-02-09 10:41         ` Lars Ingebrigtsen
2022-02-09 10:47           ` Manuel Giraud
2022-02-09 10:50             ` Lars Ingebrigtsen
2022-02-09 12:30           ` Manuel Giraud
2022-02-09 16:35             ` Eric Abrahamsen
2022-02-10  9:02               ` Manuel Giraud
2022-02-10 18:11                 ` Eric Abrahamsen
2022-02-10 18:25                   ` Eric Abrahamsen
2022-02-10 20:25                   ` Eli Zaretskii
2022-02-10 20:37                     ` Eric Abrahamsen [this message]
2022-02-11 10:57                   ` Manuel Giraud
2022-02-11 17:53                     ` Eric Abrahamsen
2022-02-09  8:20 ` Lars Ingebrigtsen
2022-02-09  9:52   ` Manuel Giraud
2022-02-09 20:26     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sfsq8nl7.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=53877@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.org \
    --cc=manuel@ledu-giraud.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).