Jan 072009

First, I figured I’d mention that I’m aware that there are issues with missing strings on the Mozilla Developer Center site’s skin.  I’m not sure how they got misplaced, and we’re investigating it so we can fix it properly.  Everything still functions, it just looks strange.

Second, next week I’ll begin evaluating the upcoming “Lyons” release of the Deki software on a VM at home, so I can start providing feedback to MindTouch on how well it meets the needs of our users and contributors.  I’m aware that some of you guys have very vigorous opinions about the current state of MDC, so I’m going to be trying my best to drive their development in a direction that will make everyone happy.  With over a month until its release, there’ll be time to have further impact on the development as it winds down.

It’s important to note that this release, as well as the last major release (Jay Cooke), is very heavily driven by Mozilla’s needs.  The folks at MindTouch are trying really hard to make us happy, and while they (and I) know there are outstanding issues, they’re doing a lot of work to make it do everything we need.  Please try to be patient a little bit longer!

Once we get upgraded to Lyons, it’ll be time for us to start looking at ways we can augment the capabilities of Deki to customize it for our needs.  Deki is highly extensible, but we’ve so far been avoiding doing any serious customization until the core features get more closely matched to our needs.  I believe that Lyons will accomplish that goal, so it will be time to start work on adding our own whiz-bang goodness to MDC.  We’ll talk more about that as we get closer to doing that.

One other note of importance: I’ve updated the documentation on web workers to match the capabilities and API as it currently stands in prerelease builds of Firefox 3.1 beta 3, as well as the current draft of the specification.  See:

Please let me know of any issues you see.  I’m aware that a sample or two are still missing; those will be dealt with soon.

 Posted by at 6:29 PM

  3 Responses to “MDC stuff and notes”

  1. Using DOM Workers page

    # var myWorker = new Worker(‘my_worker.js’);
    # myWorker.onmessage = function(event) {
    # print(“Called back by the worker!\n”);
    # };

    It is unclear when the worker starts, so this looks like a bad example with a race condition.

    If worker starts as soon as it is created [1], it looks like there is a race condition between the worker starting and adding the onmessage or onerror handler. If the worker thread signals before the handler is added, then the handler won’t get called. Worse, the behavior will be intermittent, sometimes it may be called and sometimes it won’t, or it may depend on the platform.

    Maybe the initial handlers should be provided as parameters to the worker constructor to avoid this race condition (spec bug?).
    Maybe the worker should have a separate .start() method so handlers can be initialized before it starts to avoid this race.

    [1] http://www.whatwg.org/specs/web-workers/current-work/#worker2

  2. I’m taking your comment to the guys that wrote the worker code, and we’ll see what they have to say. Thanks!

  3. Gc:

    Since JavaScript always runs to completion and blocks the thread it’s running on, there’s never a race condition here. Any message passed from one thread to another is placed in a queue to be run as soon as the target thread is no longer busy.

    So in your example, if the worker tries to pass any message back to the main thread it won’t be processed until the main thread has finished running its script, and that means the message handler will already have been set up.