Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: 5335601b6b6a88f5244d09fd2c1e531a1918ec12
      
https://github.com/Perl/perl5/commit/5335601b6b6a88f5244d09fd2c1e531a1918ec12
  Author: Karl Williamson <k...@cpan.org>
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Move unnecessary work out of toggled state

In some Configurations, toggling the locale can interfere with other
executing threads.  As of GH #21908, the current Configurations where
this is true are critical sections.  This commit takes one such place
and moves unnecessary work to outside the critical section/toggled
locale.

The downside of this change is that we may have to retoggle to the
locale later in the called function get_locale_string_utf8ness_i(),
which may call is_locale_utf8().  This would be wasted effort in those
Configurations where toggling doesn't interfere, but often the toggling
is avoided, in part because of caching, and in part because the most
frequent calls to this function result in ASCII data which don't require
toggling.

A scheme could be created to avoid any such possibility, but I don't
think it's worth it.


Reply via email to