Questions tagged [dispatcher]

In WPF and Silverlight, Dispatcher is an object that is used to execute work on a specific thread. In another meaning, dispatcher defines an object that receives requests from the client and sends them to any resource (such as a servlet, HTML file, or JSP file) on the server.

In and , Dispatcher is an object that is used to execute work on a specific .

In another meaning, a dispatcher object can forward a client's request to a resource or include the resource itself in the response back to the client. A resource can be another servlet, or an HTML file, or a JSP file, etc.

1296 questions
5
votes
3 answers

Why does Ruby on Rails create new Sessions on every hit (sometimes)?

for some reason, the session handler in my RoR application seems to act weird in production for many users. I am using the default RoR ActiveRecord Session Store and in development everything works just fine. As long as I keep the browser open, one…
jhuebner
  • 71
  • 1
  • 3
5
votes
2 answers

How do I avoid a race condition when using Dispatcher.Run()?

I've found little information on how to properly use the Dispatcher class on its own. Currently I am using it similar to this question, but there is an inherent race condition which I do not see mentioned anywhere. Assuming you use the following…
Travis
  • 2,654
  • 4
  • 26
  • 46
5
votes
4 answers

How to update ObservableCollection from inside a BackgroundWorker using MVVM?

since two days I am trying to solve the following problem: I have a WPF control where a WrapPanel is bound to an ObservableCollection. An action changes the content of the ObservableCollection. The content is loaded in a BackgroundWorker.…
Kai
  • 1,277
  • 2
  • 15
  • 25
5
votes
1 answer

Silverlight Dispatcher event queue order

Is the Silverlight Dispatcher event queue's ordering strictly preserved? To elaborate: If I have exactly one other thread calling Dispatcher.BeginInvoke, is it guaranteed that those calls will be processed on the UI thread in the same order, or is…
Charles
  • 6,199
  • 6
  • 50
  • 66
5
votes
2 answers

InvalidOperationException: dispatcher processing has been suspended, but messages are still being processed

We are having multiple issues with this exception but I cannot find technical documentation about the real cause of the issue, all the possible sources for this error and what should we avoid to avoid having the exception. I have read the…
Ignacio Soler Garcia
  • 21,122
  • 31
  • 128
  • 207
5
votes
2 answers

Program hanging on Dispatcher.Run() c#

I'm using this code to run ProgressBar in separate thread. ProgresBarForm viewer = new ProgressBarForm("Wait"); Thread viewerThread = new Thread(delegate() { viewer = new ProgressBarForm("Wait"); viewer.Show(); …
DinosaurTom
  • 212
  • 4
  • 15
5
votes
1 answer

NUnit test process fails frequently with WPF controls

We have an NUnit test project with 1000 tests or so. The project contains high level component test mainly for a custom WPF control. The test process frequently fails on our build server (TeamCity) with: InvalidOperationException "LocalDataStoreSlot…
pappati
  • 171
  • 1
  • 9
5
votes
2 answers

wpf window (ui) blocked by long rendering operation - possible to use background thread for rendering?

The app window blocks while a rendering operation is active. I.e. when the Content property of a ContentControl is set. A user control which is a DataTemplate for the content is drawn. The freeze lasts between 5 and 10 seconds depending on the PC…
h.alex
  • 902
  • 1
  • 8
  • 31
5
votes
1 answer

Binding a new Dispatcher to a thread in WPF

I have a situation where I am showing a Window which acts as a splash screen. This window is created on a separate thread from the main ui thread and as such it is associated with its own Dispatcher (i.e. I end up with 2 Dispatchers the Main Ui…
Damian
  • 2,709
  • 2
  • 29
  • 40
5
votes
2 answers

Weird Thread exception when using Dispatcher.BeginInvoke in a thread

I'm running a pretty time-consuming method in a thread, and one of the things it does, is if there is no image available it sets a grid named Background's background to a solid color. Here's how that snippet looks: SolidColorBrush scb = new…
Tokfrans
  • 1,939
  • 2
  • 24
  • 56
5
votes
1 answer

Threading 101: What is a Dispatcher?

Once upon a time, I remembered this stuff by heart. Over time, my understanding has diluted and I mean to refresh it. As I recall, any so called single threaded application has two threads: a) the primary thread that has a pointer to the main or…
5
votes
2 answers

Different thread owns it in WPF

This is a UserControl that I am using. this.CardHolderName.Content is a label that is in the UI of the user control. public partial class PersonCredential : UserControl { public PersonCredential() { …
5
votes
1 answer

Does Dispatcher.Invoke block on the calling thread?

I was wondering if, when calling Dispatcher.Invoke, the calling thread would wait until the dispatcher finished its operation or not...? For example: new Thread(() => { string x = "Yes."; // Invoke the dispatcher. …
Alexandru
  • 12,264
  • 17
  • 113
  • 208
5
votes
3 answers

Locking multiple external resources in Jenkins

Is it possible to lock multiple external resources to a build in Jenkins? We have tried the External Resource Dispatcher Plugin but did not succeed.
user2582961
  • 51
  • 1
  • 2
5
votes
2 answers

Confusion about Refreshing the UI in WPF

I have heard that this refreshes the UI but why so? Dispatcher invokes this empty action and thats it there is no call InvalidateMeasure() which would trigger the UI to re-measure and re-arrange and re-render inside the action. Where is here the…
snowy hedgehog
  • 652
  • 1
  • 7
  • 23