Subject: Re: bug#23269: Multi-threaded operation, mbrtowc, and "untangle" script [was Re: bug#23269...]

From: [email-masked]
Date: Thu, 21 Apr 2016 03:55:59 -0600

sur-behoffski <[email-masked]> wrote:

> So, I'm not sure if a thread-safe (i.e. locale-safe) version of mbrtowc
> exists; if not, this needs to be addressed before a split-locale,
> multi-threaded version is feasible.  (LC_CTYPE race conditions?)

By definition, mbrtowc is thread safe.  The question relates better
to setlocale(), or rather to the underlying internal locale data. I don't
think the current POSIX model lends itself to multiple locales within
the same process.

I have to wonder if a multi-threaded grep makes sense in any case; it
would be a very suprising change in behavior if output from multiple
files comes out interleaved, instead of in the order the files were
specified on the command line.

My two cents, of course.

Thanks,

Arnold