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

Ask A Question

Stats

  • Questions 112k
  • Answers 112k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The following code uses the stat() function and the S_ISDIR… May 11, 2026 at 9:54 pm
  • Editorial Team
    Editorial Team added an answer I'd suggest you to have a look at the resource… May 11, 2026 at 9:54 pm
  • Editorial Team
    Editorial Team added an answer Create a shortcut (.lnk) file which contains the path to… May 11, 2026 at 9:54 pm

Related Questions

I have built a windows C++ application that I'd like to port to linux.
I have an application that gets installed with a Wise installer (EDIT: Wise creates
An html template is compiled into the application as a resource. A fragment of
this is my very first post! I'm pretty desperate so I'm going above and

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.