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

  • SEARCH
  • Home
  • 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 982913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:46:23+00:00 2026-05-16T04:46:23+00:00

I need an alternative for Dispatcher (.net 3.0) to use for a windows service

  • 0

I need an alternative for Dispatcher (.net 3.0) to use for a windows service (done in .net 2.0). Can you give me some idea how to achieve something like that or point me some links?

I know that a dispatcher has a SynchronizationContext behind, but I don’t know how I can use a SynchronizationContext into a service.

If you think that I should stick to the Dispatcher (.net 3.0) … how can I manipulate it (OnServiceStop, OnServiceStart)

edited:
More details (see also…here)

Idea is that I would like to host into my windows service some extensions/plugins which would communicate between each-other through a method ExecuteCommand(type, params).

This method also raises an event to the service in order to receive results if it was executed from inside the plugin. Each plugin could have its own thread from where it calls this method ExecuteCommand so I would like to gather and synchronize all the calls into one thread (main service thread) in order to return the result appropriately.

This is why Dispatcher came into play. But I would like to have, maybe, something in .net 2.0 or do you think Dispatcher is good in my case?

Thanks.

  • 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-05-16T04:46:24+00:00Added an answer on May 16, 2026 at 4:46 am

    Windows Services don’t have anything like the Dispatcher (or message loop in Windows Forms). If you want to marshal from one thread to another, the “target” thread will have to be running its own sort of message loop.

    If you could tell us more about what you’re trying to achieve, it would make it easier to help you.

    EDIT: Okay, it sounds like basically want a producer/consumer queue: one thread waits until something is present in the queue, and processes it. Producers can add to the queue whenever they like.

    I have a very simple implementation of a producer/consumer queue in my threading tutorial, but there may be more advanced implementations around. (.NET 4 makes this easy, but it’s harder in .NET 2.) If you do take my implementation, you’ll want to think about making it generic and adding termination conditions. Joe Albahari has another implementation you should look at, too.

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

Sidebar

Related Questions

I am working in .Net environment using C#. I need some alternative for the
Since ASP.NET response filtering and post-cache substitution are not compatible, I need an alternative
Does anyone knows any free alternative MySQL Enterprise Monitor? I need some tool, that
I need some alternative of implode for mysql queries.After research found concat functions. Question
I think I need some clarifications regarding WPFs Dispatcher.Invoke and Dispatcher.BeginInvoke usage. Suppose I
I need an alternative to using the CF function imageNew(). I started to use
I need an alternative to the std library's matrix functions, preferably one that is
Just for the pleasure of learning, I don´t need an alternative solution (I know
I need a cPanel alternative, but with easy deployable Ruby-Rack applications support, not only
I need to find an open source alternative to VSS where people will share

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.