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

  • Home
  • SEARCH
  • 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 715011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:08:21+00:00 2026-05-14T05:08:21+00:00

Let’s say i have a Domain Model that im trying to make compatible with

  • 0

Let’s say i have a Domain Model that im trying to make compatible with multithreading.
The prototype domain is a game domain that consists of Space, SpaceObject, and Location objects.
A SpaceObject has the Move method and Asteroid and Ship extend this object with specific properties for the object (Ship has a name and Asteroid has a color)

Let’s say i want to make the Move method for each object run in a seperate thread. That would be stupid because with 10000 objects, i would have 10000 threads. What would be the best way to seperate the workload between cores/threads?

I’m trying to learn the basics of concurrency, and building a small game to prototype a lot of concepts.

What i’ve already done, is build a domain, and a threading model with a timer that launches events based on intervals. If the event occurs i want to update my entire model with the new locations of any SpaceObject.
But i don’t know how and when to launch new threads with workloads when the event occurs.

Some people at work told me that u can’t update your core domain multithreaded, because you have to synch everything. But in that case i can’t run my game on a dual quadcore server, because it would only use 1 CPU for the hardest tasks.

Anyone know what to do here?

Specification in reaction to Deltreme:

You are absolutly right, and your method will work in most cases. BUT,
The threads have to update the location of the spaceobject in the Space class.

Let’s say i have 2 SpaceObjects next to eachother, they are moving towards eachother. 1 Object is in thread A, the other is in thread B.
Once i update the objects the threads have to write to the Space together to write the new values in the Tile (an individual part of Space). That individual call cannot be done in different threads at once, cause the Space object would burst…

What could happen is a collision, and i could write an Event that occurs if their are 2 ships @ 1 tile. That’s not the problem.

I’m thinking that in the case of 10000 ships, the CPU would primarily be switching between threads and not running them all togheter.
So in the interest of performance, i want to be able to to “everything” simultaniously

  • 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-14T05:08:21+00:00Added an answer on May 14, 2026 at 5:08 am

    You can use System.Threading.ThreadPool or the upcoming Task Parallel Library to automatically manage your thread counts according to the number of cores available.

    One possible approach to the concurrency problem is to lock only other SpaceObjects that your current SpaceObject could interact with. This would provide adequate performance in most cases, but processing large interactions would be done by a single thread in the worst case. How much do you need to lock ultimately depends on your simulation parameters. If objects can’t completely pass through each other within a single tick of the timer, you can get away with just checking for overlapping objects. For fast-moving objects you would need to detect intersecting movement vectors.

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

Sidebar

Related Questions

Let's say that we have an ARGB color: Color argb = Color.FromARGB(127, 69, 12,
Let's say I'm building a data access layer for an application. Typically I have
Let's say you have a class called Customer, which contains the following fields: UserName
Let me try to explain what I need. I have a server that is
Let's say we have a simple function defined in a pseudo language. List<Numbers> SortNumbers(List<Numbers>
Let's say I have a drive such as C:\ , and I want to
Let's say I'm writing a PHP (>= 5.0) class that's meant to be a
Let's say you create a wizard in an HTML form. One button goes back,
Let's aggregate a list of free quality web site design templates. There are a
Let me preface this question by saying I use TextMate on Mac OSX for

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.