LightSwitch and Threading

Tags: LightSwitch

Yesterday there was a question in the LightSwitch forums regarding what type of threading did LightSwitch use. Justin Anderson has returned with a really good answer and I thought I would post it.

Essentially every object you interact with through code has affinity to a particular thread in the application. You interact with every thread through the use of dispatchers, which allow you to execute a block of code on the thread that the dispatcher owns.

A LightSwitch application has several dispatchers:

  • One dispatcher for the main thread (sometimes referred to as the UI thread). Any access to UI elements must be done on this dispatcher.
  • One dispatcher for the LightSwitch application.
  • One dispatcher for each open screen.

Here is a link to the Forum Post where he also has some more information on the topic. (Link)

Add a Comment

brisbanedating