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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:48:09+00:00 2026-06-15T07:48:09+00:00

I have an Azure Worker Role that has three types of processes: C# thread

  • 0

I have an Azure Worker Role that has three types of processes:

  • C# thread that reads from the database and writes to worker-input-queue (Task1)
  • Java thread that reads from worker-input-queue does work and writes to worker-output-queue
  • C# thread that reads from worker-output-queue and writes to database (Task2)

Task1 and Task2 run indefinitely and sleep if their respective queues are empty.

My code looks like this:

SpawnJavaProcesses();  
Task.Factory.StartNew(Task1);  
Task.Factory.StartNew(Task2);  
while(true)  
{  
    //do some trivial sporadic work  
    Thread.Sleep(60*1000);  
}  

My questions:

  • Should I use the LongRunning task creation option when starting Task1 and Task2?
  • Is there a better way to implement what I’m trying to do here?
  • 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-15T07:48:10+00:00Added an answer on June 15, 2026 at 7:48 am

    If you have a few threads that are long running it would be best to use the LongRunning option. By choosing this option you’ll be running in a thread outside of the thread pool. This is also something which was explained by Stephen Toub (from the Parallel Extensions team):

    It’s not a specific length per se. If you’re generating a lot of
    tasks, LongRunning is not appropriate for them. If you’re generating
    one or two tasks that will persist for quite some time relative to the
    lifetime of your application, then LongRunning is something to
    consider.

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

Sidebar

Related Questions

We have a requirement to read an excel sheet from the Azure worker role.
I have created a Azure Worker Role Project. Target machine of the project has
I have a Azure worker role perform simple selects on a SQL Azure database.
I have an Azure Worker Role that needs a repository. I normally use Ninject
I have an Azure Worker Role set up to get information from a few
I have a worker role that connects to Sql Azure retrieves a record at
I have a simple Azure Worker role running that performs a task every day
I have an Azure worker role whose job is to periodically run some code
I have a service hosted in a Worker Role in Azure. Clients connect over
I already have a hosted service deployment which has 2 worker role instances, 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.