Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8057635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:05:40+00:00 2026-06-05T09:05:40+00:00

I need to invoke method runed on timer thread on right working thread. Invoke/BeginInvoke

  • 0

I need to invoke method runed on timer thread on right working thread. Invoke/BeginInvoke process is working for me. There are 2 threads which shares one inter thread data container for data exchange. One is filling queue, one shuld process the queue. Queue raises event if it is filled after empty state. All the problem is caused by timer, which open new thread on its elapsed event. I am using Dispatcher to dispatch on the right thread, but everything works, except this Dispatcher. 🙂

Please, does anybody see where the problem is?

Complete test code is here: http://pastebin.com/jqYbR9PS.

Debug output is this:

App Thread ID: 9
Processor Thread ID: 10
Processor Dispatcher Thread ID: 10
The thread '<No Name>' (0x888) has exited with code 0 (0x0).
Processor QueueListener caller Thread ID: 12
Processor Dispatcher Thread ID: 10
Processor invoking ProcessQueue.
...here shut be processing output...
Processor invoked ProcessQueue.
App Thread ID on end: 9
The thread 'vshost.RunParkingWindow' (0x17c4) has exited with code 0 (0x0).
The thread '<No Name>' (0x820) has exited with code 0 (0x0).
The program '[5760] TestingConsoleApplication.vshost.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).

ProcessQueue is never called/invoked.

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:05:41+00:00Added an answer on June 5, 2026 at 9:05 am

    You need to actually start the dispatcher by calling Dispatcher.Run() for the dispatcher to process the calls invoked to it.

    It’s pretty strange to use a Dispatcher from a console application – the Dispatcher is used for WPF applications but I guess it will work.

    Note that the call to Dispatcher.Run() won’t return – it will enter a loop until you call Dispatcher.BeginInvokeShutdown()

    See this blog post for an example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to invoke a method without knowing a priori what will the amount
Basically; I need to invoke a method on my WPF page, from a WPF
I need to implement in my class Invoke() method with the same behavior as
I need to invoke method f . If it raises an IOError , I
I have reached this final step, where i need to invoke the PasteAndFormat method
I'm developing an application where I the need to invoke a method of a
I need to invoke a method on a class using reflection. The class contains
Is there a way to Invoke an overloaded method using reflection in .NET (2.0).
Hi I have a webapp - and in one method I need to encrypt
I need to invoke a method each time an event is occurred even if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.