What is the relationship between the JavaScript thread and the Silverlight UI thread? What is the relationship between the JavaScript thread and the Silverlight UI thread? multithreading multithreading

What is the relationship between the JavaScript thread and the Silverlight UI thread?


I haven't used Silverlight, but I've done pretty extensive work with Java Applets and Flash, so I'll comment from that perspective.

You're right that JavaScript is single-threaded. Anything that causes it to block will prevent all other computation and actions. It will even lock the browser in some cases, though newer browsers are getting better at separating out tabs into separate processes, which helps.

Any thread in a plugin like Silverlight is completely separate from JavaScript in the browser. The interfaces between them may be blocking however. If Silverlight's UI thread blocks when communicating with native JS, then no other work will be done on that thread while it's waiting. Other threads can continue to work as normal.

To address your question about whether JS can execute concurrently while actions on the Silverlight UI thread are running, I don't see why not. They have separate runtimes, and as long as they're not intercommunicating (which would cause one to block), they should be able to keep running fine in isolation.

My gut says the same would be true of multiple Silverlight instances in the same page, but that's really an architectural design question that I'm not able to answer.

Hope this helps!