On Wed, Nov 19, 2008 at 2:08 PM, Dmitry Titov <span dir="ltr"><<a href="mailto:dimich@chromium.org">dimich@chromium.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Pages communicate with their workers (dedicated) via <a href="http://www.whatwg.org/specs/web-workers/current-work/#the-queue" target="_blank">queue of events</a> . What happens if the queue gets more and more events queued (as a result of postMessage or timer callbacks) and the worker thread does not consume them fast enough?<div>
<br></div><div><ul><li>setInterval can skip posting a callback if the previously posted one was not yet consumed. <br></li><li>setTimeout is probably ok as it is but if the worker script adds them in a loop it can be a problem.<br>
</li><li>postMessage could somehow indicate a queue overflow and ignore the attempt to post a message if the queue length exceeds some specific threshold.<br></li></ul></div><div><br></div><div>Basically, the queue probably should have a limit on it and once the limit is reached, the queue-based operations should start to fail, optionally with some indication.</div>
</blockquote><div> </div></div>How is this different from any other out-of-memory situation? Web APIs generally don't specify OOM behaviour.<br><br clear="all">Rob<br>-- <br>"He was pierced for our transgressions, he was crushed for our iniquities; the punishment that brought us peace was upon him, and by his wounds we are healed. We all, like sheep, have gone astray, each of us has turned to his own way; and the LORD has laid on him the iniquity of us all." [Isaiah 53:5-6]<br>