[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Experiment with threads - no concurrency?
From: |
Arthur Miller |
Subject: |
Re: Experiment with threads - no concurrency? |
Date: |
Mon, 06 Sep 2021 18:40:46 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Arthur Miller <arthur.miller@live.com>
>> Date: Mon, 06 Sep 2021 16:35:04 +0200
>>
>> I did a little experiment today. I wanted to count frequency of Emacs
>> functions
>> usage. So I started by indexing all functions and macros.
>>
>> Since it is kind of lot's of I/O and independent tasks to do, I thought
>> threads
>> could come handy. However I see no difference from sequential code.
>
> You shouldn't. Emacs doesn't switch threads on just any I/O, it
> switches threads when it waits for input from subprocesses, network,
> and keyboard.
Allright, so in order to exploit I/O concurrency here, the only way is to start
another emacs process asynchronously? Could split file list I get from
directory-files-recursively into say 4 parts, and process files in 4
processes. Is there any benefit to use threads in that case?
Not that it is terribly important, it takes like 3 seconds to parse all files in
lisp dir sequentially, but now when I opened the question ...