[whatwg] MessagePorts and message delivery ordering

Drew Wilson atwilson at google.com
Thu Aug 6 14:26:33 PDT 2009

I was writing some unit tests for SharedWorkers, and I saw some behavior
that seems to be spec compliant, but which was counter-intuitive from a
developer standpoint.
Let's say that you have two message ports - some other window or a shared
worker owns the other end of those ports.

You then do this:


At the other end, the order of the delivery of these messages is entirely
arbitrary (could be "foo"->"bar", or "bar"->"foo") even though those ports
share the same owner. This is because each port is an individual task
source, and ordering within a given task source is guaranteed by the spec,
but ordering across task sources is intentionally not guaranteed (this
allows UAs to prioritize task sources).

Anyhow, just thought I'd point it out, and make sure there isn't something
in the spec that I missed that should affect delivery ordering in this case.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20090806/7fff7210/attachment-0002.htm>

More information about the whatwg mailing list