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

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Swap the order of two functions

The new ordering will make the diffs less in the next commit, and will
make just as much sense going forward as the previous ordering.


  Commit: 48e13c73f8ef9673271e1fbf897f63d3015082be
      
https://github.com/Perl/perl5/commit/48e13c73f8ef9673271e1fbf897f63d3015082be
  Author: Karl Williamson <k...@cpan.org>
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
    M embed.fnc
    M embed.h
    M locale.c
    M proto.h

  Log Message:
  -----------
  locale.c: Pass locale to strftime functions

This will allow a future commit to reduce the amount of time spent in a
critical section.

It requires the least duplication of code for this commit to create a
new function sv_strftime_common() which takes over the bulk of the code
from sv_strftime_tm(), which becomes just a small wrapper.  The new
function adds a 'locale' parameter, and the other functions that now
need to know the locale get it, and then call this new function.


  Commit: 21c86441f401ad5bf84e6df10e39c5ab251a9e32
      
https://github.com/Perl/perl5/commit/21c86441f401ad5bf84e6df10e39c5ab251a9e32
  Author: Karl Williamson <k...@cpan.org>
  Date:   2024-02-15 (Thu, 15 Feb 2024)

  Changed paths:
    M locale.c

  Log Message:
  -----------
  locale.c: Shorten critical section times

Toggling a category's locale has a cost, so if there are a bunch of
operations that are going to be done in a row in a particular toggled
state, it makes sense to toggle once, do them all, then toggle back.
Most of the toggling in this file is short term, but there are a few
places where it is advantageous to toggle once.

But on some Configurations, toggling creates a critical, uninterruptible
section.  For these, keeping the amount of time spent in such a state
without letting other threads execute needs to be as short as feasible,
and this outweighs the cost of toggling and retoggling.

This commit balances these competing needs by creating new macros for
those cases where we want to have an overarching toggle.  Those macros
become no-ops when the toggling creates an uninterruptible section.
Thus, when there is a cost to remaining toggled for longer periods,
those macros don't do anything, and the macros that are at the point of
the actual need are the ones that do the toggling/retoggling.  In the
Configurations where there isn't such a cost, the overarching macros
kick in, and the shorter-term ones find that the state is already
toggled, and they return without doing anything.


Compare: https://github.com/Perl/perl5/compare/b0e1190490d1...21c86441f401

Reply via email to