Branch: refs/heads/blead
  Home:   https://github.com/Perl/perl5
  Commit: e5c2d3e727814fcfe067f1ee4a71109b8ff2a92c
      
https://github.com/Perl/perl5/commit/e5c2d3e727814fcfe067f1ee4a71109b8ff2a92c
  Author: Karl Williamson <[email protected]>
  Date:   2024-02-07 (Wed, 07 Feb 2024)

  Changed paths:
    M hints/freebsd.sh
    M locale.c

  Log Message:
  -----------
  Avoid unnecessary mutex lock on Windows

It turns out that Windows since VS 2015 has a completely thread-safe
localeconv() function, with its result stored in a per-thread buffer.
MingW when built with the Universal C Run Time (UCRT) also has this
property.  These are the only implementations of localeconv() I know of
like this.

There is thus no need to have a critical section on these platforms.

This commit abstracts this, so that other platforms can be added if
found to be thread-safe.


  Commit: de957aa6f7fb26fdb92ae48ca7037276b88fd8f6
      
https://github.com/Perl/perl5/commit/de957aa6f7fb26fdb92ae48ca7037276b88fd8f6
  Author: Karl Williamson <[email protected]>
  Date:   2024-02-07 (Wed, 07 Feb 2024)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Combine some Win32 #directives

This creates a teardown macro that is empty if unneeded, to reduce the
number of #if directives in this function


  Commit: 8e242e6850168078d76e26707b5beeb56f7b9c13
      
https://github.com/Perl/perl5/commit/8e242e6850168078d76e26707b5beeb56f7b9c13
  Author: Karl Williamson <[email protected]>
  Date:   2024-02-07 (Wed, 07 Feb 2024)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: White space only

This mainly outdents some #directives which are no longer within the
control of another #directive removed in a previous commit.


  Commit: 37f948bc236afb3a8e36100dc25c00b191935b97
      
https://github.com/Perl/perl5/commit/37f948bc236afb3a8e36100dc25c00b191935b97
  Author: Karl Williamson <[email protected]>
  Date:   2024-02-07 (Wed, 07 Feb 2024)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Do simple adjustment in a critical section

This adjustment was deferred until after the critical section, but it is
only an extra conditional and variable set, whose time should be dwarfed
by the store to the hash, so I think it's all right to add it to the
critical section.


  Commit: 9ea33191b4761c5947f472494b38cbf61a21b8bb
      
https://github.com/Perl/perl5/commit/9ea33191b4761c5947f472494b38cbf61a21b8bb
  Author: Karl Williamson <[email protected]>
  Date:   2024-02-07 (Wed, 07 Feb 2024)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  Do localeconv() adjustments immediately unthreaded

localeconv() must be called and its struct processed in a critical
section when other threads or embedded perls could also be using it.
Something like StructCopy can't be used to save its values, as a deep
copy is needed.  Some of the processing can be expensive, so is deferred
to a separate pass after the critical section.

But if no critical section is needed, it's cheaper to do the processing
as we go along doing the copy.  A comment removed in this commit said
that the reason this wasn't done was because of an extra maintenance
cost (having to maintain the code in two places).  But when I actually
looked at what it would like like to do this, I found it is essentially
just an extra function call, not enough "extra" to worry about.


Compare: https://github.com/Perl/perl5/compare/b6ac642e0c63...9ea33191b476

Reply via email to