emacs-devel
[Top][All Lists]
Advanced

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

Re: make-thread with lambda form instead of function symbol


From: Eric Abrahamsen
Subject: Re: make-thread with lambda form instead of function symbol
Date: Sun, 16 Apr 2017 20:45:19 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Noam Postavsky <address@hidden> writes:

> On Sun, Apr 16, 2017 at 9:12 PM, Eric Abrahamsen
> <address@hidden> wrote:
>>
>> (defun nnir-run-query (specs)
>>   (let* ((results [])
>>          (threads
>>           (mapcar
>>            (lambda (x)
>>              (let* ((server (car x))
>>                     (search-engine (nnir-server-to-search-engine server)))
>>                (make-thread
>>                 (lambda ()
>>                   (setq results
>>                         (vconcat
>>                          (nnir-run-search
>>                           search-engine
>>                           server
>>                           (cdr (assq 'nnir-query-spec specs))
>>                           (cadr x))
>>                          results))))))
>>            (cdr (assq 'nnir-group-spec specs)))))
>>     (mapc #'thread-join threads)
>>     results))
>>
>> I'm testing with a single IMAP server query (ie, only one thread is
>> being created). The nnir-run-search function for the IMAP backend ends
>> up calling nnimap-send-command--> nnimap-wait-for-response-->
>> nnheader-accept-process-output--> accept-process-output, so I'm
>> expecting that's where the thread yields.
>>
>> I'm attaching the traceback here. Dunno if it's something I've done
>> wrong...
>
>> #4  0x000000000069f953 in Faccept_process_output (process=..., seconds=..., 
>> millisec=..., just_this_one=...) at process.c:4566
>
> Is line process.c:4566 this one?
>
>     error ("Attempt to accept output from process %s locked to thread %s",
>            SDATA (proc->name), SDATA (XTHREAD (proc->thread)->name));
>
> I guess that indicates you might be doing something wrong (though
> obviously Emacs shouldn't be crashing)

So perhaps an existing process can't be "moved" to another thread?
Tomorrow I'll set up a notmuch-indexed server and try that -- in that
case the process should be invoked and concluded within a single
make-thread call, so maybe it won't raise this error.

But the segfault here seems to be coming from a borked attempt to
represent either the process or the thread as a string....




reply via email to

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