bug-gnulib
[Top][All Lists]
Advanced

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

Re: dfa MT-safe?


From: Bruno Haible
Subject: Re: dfa MT-safe?
Date: Sun, 15 Dec 2019 13:06:22 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-166-generic; KDE/5.18.0; x86_64; ; )

Arnold Robbins wrote:
> Paul Eggert <address@hidden> wrote:
> > Yes it is supposed to be.
> 
> News to me.

:) It's time that we start documenting the multithread-safety of the gnulib
modules. Cf. [1]

> In any case, gawk's use of it is (and will remain) single-threaded.
> It'd be nice if your fix did not pull in more libraries, like libpthread
> or whatever, since that would considerably complicate things for me,
> for no actual gain w.r.t. gawk.

If you add these two lines to configure.ac:
  gl_cv_func_setlocale_null_all_mtsafe=yes
  gl_cv_func_setlocale_null_one_mtsafe=yes
no additional libraries will be needed.

> I'm curious what is the use case for multithreaded dfa?

One could speed up
  grep -r PATTERN DIRECTORY_WITH_MANY_FILES
by a large factor (probably 4x or 5x, on a CPU with 8 threads).
This would be done by modifying 'grep' to process each file in a
separate thread. The kernel can feed the data of these files to 'grep'
in parallel. Only the output phase needs to serialize things.

José Marchesi suggested this, a couple of months ago.

Bruno

[1] https://lists.gnu.org/archive/html/bug-gnulib/2019-12/msg00002.html




reply via email to

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