<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebAssembly: test compile / instantiate in a Worker"
   href="https://bugs.webkit.org/show_bug.cgi?id=166480#c7">Comment # 7</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebAssembly: test compile / instantiate in a Worker"
   href="https://bugs.webkit.org/show_bug.cgi?id=166480">bug 166480</a>
              from <span class="vcard"><a class="email" href="mailto:jfbastien&#64;apple.com" title="JF Bastien &lt;jfbastien&#64;apple.com&gt;"> <span class="fn">JF Bastien</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=166480#c6">comment #6</a>)
<span class="quote">&gt; (In reply to <a href="show_bug.cgi?id=166480#c5">comment #5</a>)
&gt; &gt; (In reply to <a href="show_bug.cgi?id=166480#c4">comment #4</a>)
&gt; &gt; &gt; (In reply to <a href="show_bug.cgi?id=166480#c3">comment #3</a>)
&gt; &gt; &gt; &gt; (In reply to <a href="show_bug.cgi?id=166480#c2">comment #2</a>)
&gt; &gt; &gt; &gt; &gt; (In reply to <a href="show_bug.cgi?id=166480#c1">comment #1</a>)
&gt; &gt; &gt; &gt; &gt; &gt; (In reply to <a href="show_bug.cgi?id=166480#c0">comment #0</a>)
&gt; &gt; &gt; &gt; &gt; &gt; &gt; I've heard from someone trying out WebAssembly that they current use compile
&gt; &gt; &gt; &gt; &gt; &gt; &gt; / instantiate in a worker because some implementations aren't asynchronous.
&gt; &gt; &gt; &gt; &gt; &gt; &gt; They want to do work on the main thread while compiling, so a Worker makes
&gt; &gt; &gt; &gt; &gt; &gt; &gt; sense. They then transfer the Module / Instance back to the main thread.
&gt; &gt; &gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; &gt; &gt; We should have a test that this works well.
&gt; &gt; &gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; &gt; &gt; Related:
&gt; &gt; &gt; &gt; &gt; &gt; &gt;  - WebAssembly: Make WebAssembly.compile truly asynchronous
&gt; &gt; &gt; &gt; &gt; &gt; &gt; <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebAssembly: Make WebAssembly.compile truly asynchronous"
   href="show_bug.cgi?id=166016">https://bugs.webkit.org/show_bug.cgi?id=166016</a>
&gt; &gt; &gt; &gt; &gt; &gt; &gt;  - WebAssembly: Implement the WebAssembly.instantiate API
&gt; &gt; &gt; &gt; &gt; &gt; &gt; <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebAssembly: Implement the WebAssembly.instantiate API"
   href="show_bug.cgi?id=165982">https://bugs.webkit.org/show_bug.cgi?id=165982</a>
&gt; &gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; &gt; I think this should work as expected regardless of the compile API being
&gt; &gt; &gt; &gt; &gt; &gt; asynchronous internally.
&gt; &gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; &gt; Also, I agree we should have a test for this.
&gt; &gt; &gt; &gt; 
&gt; &gt; &gt; &gt; Right, I want to make sure postMessage-ing Module / Instance / Memory /
&gt; &gt; &gt; &gt; Table all work as expected.
&gt; &gt; &gt; 
&gt; &gt; &gt; Interesting. Is that the expected behavior? This is unlike anything we do
&gt; &gt; &gt; elsewhere. We don't postMessage heap cells since each worker is in a
&gt; &gt; &gt; different VM
&gt; &gt; 
&gt; &gt; I don't know what's expected :-D
&gt; 
&gt; We won't be able to compile a Module then ship over the module across
&gt; workers. We will be able to have workers that have their own
&gt; Modules/Instances/etc that can run independently. We need to think about
&gt; what happens when we try to ship over an ArrayBuffer for Memory. This should
&gt; probably not be allowed since it's backed by Wasm::Memory mmaped memory.</span >

IIUC they serialize WebAssembly.Module, and transfer it from Worker to main thread. Apparently this works in Chrome / FF. Should we file an issue on this in the design repo?</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>