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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T16:33:02+00:00 2026-05-10T16:33:02+00:00

I have built an application in C# that I would like to be optimized

  • 0

I have built an application in C# that I would like to be optimized for multiple cores. I have some threads, should I do more?

Updated for more detail

  • C# 2.0
  • Run on Windows Vista and Windows Server 2003

Updated again

  • This code is running as a service
  • I do not want to have the complete code… my goal here is to get your experience and how to start. Like I say, I have already use threads. What more can I do?
  • 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. 2026-05-10T16:33:03+00:00Added an answer on May 10, 2026 at 4:33 pm

    I’d generalize that writing a highly optimized multi-threaded process is a lot harder than just throwing some threads in the mix.

    I recommend starting with the following steps:

    1. Split up your workloads into discrete parallel executable units
    2. Measure and characterize workload types – Network intensive, I/O intensive, CPU intensive etc – these become the basis for your worker pooling strategies. e.g. you can have pretty large pools of workers for network intensive applications, but it doesn’t make sense having more workers than hardware-threads for CPU intensive tasks.
    3. Think about queuing/array or ThreadWorkerPool to manage pools of threads. Former more finegrain controlled than latter.
    4. Learn to prefer async I/O patterns over sync patterns if you can – frees more CPU time to perform other tasks.
    5. Work to eliminate or atleast reduce serialization around contended resources such as disk.
    6. Minimize I/O, acquire and hold minimum level of locks for minimum period possible. (Reader/Writer locks are your friend)
      5.Comb through that code to ensure that resources are locked in consistent sequence to minimize deadly embrace.
    7. Test like crazy – race conditions and bugs in multithreaded applications are hellish to troubleshoot – often you only see the forensic aftermath of the massacre.

    Bear in mind that it is entirely possible that a multi-threaded version could perform worse than a single-threaded version of the same app. There is no excuse for good engineering measurement.

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

Sidebar

Related Questions

I have built a Java application that has some dependencies (~10). I would like
We have built a web application that accepts SOAP messages, does some processing, calls
I have built a windows C++ application that I'd like to port to linux.
I have built an application that uses SQL Express 2005 and I want to
I have built a MS Access 2007 application that can create reports files in
I have built a web application using Java EE platform that sells one of
I have an already built application and I want to add a feature that
I have an application that is built against OpenSceneGraph (2.6.1) and therefore indirectly OpenGL.
I have an application that will accept URLs from the built in web browser
I have built an application in CakePHP that lists businesses. There are about 2000

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.