<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - TextBreakIterator: unconvolute character break cache"
   href="https://bugs.webkit.org/show_bug.cgi?id=162001">162001</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>TextBreakIterator: unconvolute character break cache
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Unspecified
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Web Template Framework
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jfbastien&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>TextBreakIterator's character break cache is weird.

Added here (fixed a bit after): <a href="https://bugs.webkit.org/attachment.cgi?id=144118&amp;action=prettypatch">https://bugs.webkit.org/attachment.cgi?id=144118&amp;action=prettypatch</a>
Updated to never use a lock, and always use weak cmpxchg here: <a href="https://bugs.webkit.org/attachment.cgi?id=261719&amp;action=prettypatch">https://bugs.webkit.org/attachment.cgi?id=261719&amp;action=prettypatch</a>

It's just trying to reduce the number of times it calls into ICU to initialize a UBRK_CHARACTER. The implementation keeps a one-element cache of the latest used one, which threads can optimistically grab. Failure is fine (just create a new one), same for failure to cache (just destroy it), but the logic is odd and you technically need release / acquire semantics because the UBRK_CHARACTER creation's store need to be visible on acquisition (but realistically it was created and then used and *then* cached, so it's probably been long ago enough that read reorders never manifested).</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>