You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The wait/wake tests were not written to work in a browser, only in a JS shell, and there are several things that must change before they can work in a browser:
For example, Firefox requires the creator of a Worker to return to the event loop after creating the Worker, before the Worker will start. (ISTR that @binji told me at some point he thinks Chrome may have the same restriction.) The wait/wake tests currently assume that $262.agent.start() will start the worker and the test can just forge ahead; it just ain't so. At a minimum, $262.agent.start() must take a continuation to be invoked once the worker is properly up, in the manner of $262.agent.broadcast().
For another example, $262.agent.sleep() is used on the main thread in these tests, and that is OK for a shell but generally a problem in the browser: If the main thread is busy-waiting for something to happen on the worker while the worker happens to need the main thread to accomplish something, we'll deadlock. (At least in Firefox the main thread performs some work on behalf of workers.) And busy-waiting is the only way to implement sleep on the main thread, absent a callback-based method. The appropriate fix here is likely to remove $262.agent.sleep() on the main thread - it should still be available in an agent - and to rewrite the tests, probably by adding new agents that perform the tasks currently performed by the main thread. Additional $262.agent functionality may be needed to trigger a callback in the main thread that the test is finished.
The wait/wake tests were not written to work in a browser, only in a JS shell, and there are several things that must change before they can work in a browser:
For example, Firefox requires the creator of a Worker to return to the event loop after creating the Worker, before the Worker will start. (ISTR that @binji told me at some point he thinks Chrome may have the same restriction.) The wait/wake tests currently assume that
$262.agent.start()
will start the worker and the test can just forge ahead; it just ain't so. At a minimum,$262.agent.start()
must take a continuation to be invoked once the worker is properly up, in the manner of$262.agent.broadcast()
.For another example,
$262.agent.sleep()
is used on the main thread in these tests, and that is OK for a shell but generally a problem in the browser: If the main thread is busy-waiting for something to happen on the worker while the worker happens to need the main thread to accomplish something, we'll deadlock. (At least in Firefox the main thread performs some work on behalf of workers.) And busy-waiting is the only way to implement sleep on the main thread, absent a callback-based method. The appropriate fix here is likely to remove$262.agent.sleep()
on the main thread - it should still be available in an agent - and to rewrite the tests, probably by adding new agents that perform the tasks currently performed by the main thread. Additional$262.agent
functionality may be needed to trigger a callback in the main thread that the test is finished./cc @binji, @akroshg, @pizlonator, @syg
The text was updated successfully, but these errors were encountered: