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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:35:30+00:00 2026-05-15T22:35:30+00:00

( Edit : to clarify, my main goal is concurrency, but not necessarily for

  • 0

(Edit: to clarify, my main goal is concurrency, but not necessarily for multi-core machines)

I’m fairly new to all concepts on concurrency, but I figured out I needed to have parallel drawing routines, for a number of reasons:

  • I wanted to draw different portions of a graphic separatedly (background refreshed less often than foreground, kept on a buffer).
  • I wanted control about priority (More priority to UI responsiveness than drawing a complex graph).
  • I wanted to have per-frame drawing calculations multithreaded.
  • I wanted to offer cancelling for complex on-buffer drawing routines.

However, being such a beginner, my code soon looked like a mess and refactoring or bug-fixing became so awkward that I decided I need to play more with it before doing anything serious.

So, I’d like to know how to make clean, easy to mantain .NET multithreaded code that makes sense when I look at it after waking up the next day. The bigest issue I had was structuring the application so all parts talk to each other in a smart (as opposed to awkward and hacky) way.

Any suggestion is welcome, but I have a preference for sources that I can digest in my free time (e.g., not a 500+ pages treatise on concurrency) and for C#/VB.NET, up to the latest version (since I see there have been advances). Basically I want something straight to the point so I can get started by playing with the concepts on my toy projects.

  • 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-15T22:35:30+00:00Added an answer on May 15, 2026 at 10:35 pm

    The Task Parallel Library is definitely the place to look for simplifying your code. I’ve personally written a (semi-long) introduction to Parallelism with .NET 4 that covers quite a few concepts that would be useful.

    Be aware, however, that you probably will want to consider leaving your drawing single threaded. You should try to keep the computation multithreaded, and the actual drawing operations done on the GUI thread.

    Most drawing APIs require all actual drawing calls to happen on the same synchronization context.

    That being said, using the new collection classes like ConcurrentQueue simplify this type of code. Try to think in terms of lots of threads (producers) adding “drawing operations” to a shared, concurrent queue – and one thread (the consumer) grabbing the operations and performing them.

    This gives you a reasonably scalable, but fairly simple design on which you can build.

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

Sidebar

Related Questions

oo design basics here... Edit: To clarify after first answer - I'm not asking
I want to rewrite my robots.txt for all domains but main one (I have
EDIT: Just to clarify, my main question boils down to this: if you issue
Edit (updated question) I have a simple C program: // it is not important
EDIT: To answer some questions, this is the revised and still not working code
EDIT: I suppose I should clarify, in case it matters. I am on a
I'm not much of a C programmer, but I was under the assumption that
[Edit #3] - to anyone reading this question: do not under any circumstance use
EDIT 07/14 As Bill Burgess mentionned in a comment of his answer, this question
EDIT: I was an idiot. I simply had an image that was vertically long,

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.