<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 - Parallel copy phase synchronization should be simplified"
   href="https://bugs.webkit.org/show_bug.cgi?id=149509">149509</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Parallel copy phase synchronization should be simplified
          </td>
        </tr>

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

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

        <tr>
          <th>Version</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>JavaScriptCore
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>fpizlo&#64;apple.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Currently, we don't wait for the copy phase to finish after we have already finished it and the copied space is unable to handle any more copy tasks joining.  This means that we have weird hacks to ensure that things don't go to badly when a copy thread starts copying after we already finished copying.  It also meant two separate mechanisms for waiting for copying threads to finish - one mechanism in the Heap phase logic and another in the CopiedSpace::doneCopying() method.

We can get rid of a lot of the weirdness by just having a sound shutdown sequence:

1) Threads concur on when there is no more work. We already have this; once Heap::getNextBlocksToCopy() returns no work in any thread, it will also return no work in any other thread that asks for work.
2) Main thread waits for the threads to not be copying anymore.
3) Do whatever we need to do after copying finishes.

Currently, we do (3) before (2) and so we have weird problems.</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>