Skip to content

Dispatcher

En klasse som står for at håndtere køen af objekter til UI tråden.

Invoke

  • Invoke kører en metode synkront
  • Executes the specified delegate synchronously on the thread the Dispatcher is associated with. therefore, control will not return to the calling object until after the callback returns.
  • Synchronous programming is a sequential execution model in which a function or method must complete before the next one can start. This often leads to blocking, where the program halts until a long-running operation finishes.

BeginInvoke

  • BeginInvoke kører en metode asynkront
  • Executes a delegate asynchronously on the thread the Dispatcher is associated with. therefore, control returns immediately to the calling object after it is called.
  • Asynchronous programming, on the other hand, allows multiple tasks to run concurrently without blocking the main thread. This approach significantly improves responsiveness and scalability in modern applications.
  • Starter det reelt en slags undertråd?