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 7896683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:57:28+00:00 2026-06-03T07:57:28+00:00

I am new to .NET environment. I need a windows service whose Start and

  • 0

I am new to .NET environment. I need a windows service whose Start and Stop method will call a specific class, say MainContext’s Start and Stop method respectively. The MainContext class will contain the list of extensions loaded through MEF. Each extensions needs to be run as a separate thread in concurrent manner.

The class MainContext will contain two public methods Start and Stop, both of return type void and containing no arguments. On calling Start method, it will start the thread for each extensions loaded through MEF in an concurrent manner. While the Stop method will stop all the threads started by Start method.

Which is the best threading practice in this situation? I am confused. Should I use System.Threading.Tasks.Task class or System.Threading.Thread class for multi-threading or should I use any other technique? Which would be better suited to my requirements and would provide me more flexibility and stability?

  • 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-03T07:57:30+00:00Added an answer on June 3, 2026 at 7:57 am

    I’ve done something similar using MAF, with add-ins watching file servers, databases, and web services. The Windows service invokes Start and Stop methods in each add-in, which in turn enable or disable System.Timer.Timers. The actual processing is done on each timer’s elapsed event handler, which runs on a pooled thread.

    One of the add-ins watches a database table that’s used inter-process communication so that I can monitor and control the other add-ins from a UI app.

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

Sidebar

Related Questions

I'm trying to write a simple website (ASP.NET v4), which will call Windows Search,
I am new to the asp.net environment coming from a Lamp background with php
I am currently working on a new application (.Net 3.5/Win2008 Server environment) that does
I am working in .Net environment using C#. I need some alternative for the
We have a new ASP.NET project on VS 2008 environment, and a new TFS
As a new .net/C# web begginner, I always get tripped up when I try
I'm intending to use the new .NET 4 Code Contracts feature for future development.
New ASP.NET Web API HttpClient has been giving me some strange results. Here is
I have a new asp.net mvc project and i am trying to figure out
I created a new ASP.NET MVC application. The home page looks like this: I

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.