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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:04:52+00:00 2026-06-11T04:04:52+00:00

So I developed a very efficient collision detection system, but the problem is that

  • 0

So I developed a very efficient collision detection system, but the problem is that it still cannot run on the main thread since it’s too damn slow.

I tried setting up some threading, and if the thread ends, another thread is created.

if (doneCollisions)
            {
                PopulateGrid();
            }


            if (doneCollisions)
            {
                Thread thread = new Thread(new ThreadStart(CheckCollisionsGrid));

                thread.Start();

            }

void CheckCollisionsGrid()
{
Thread.CurrentThread.SetProcessorAffinity(3);
            doneCollisions = false;
            //Increments through all the grids.
.
.
.
doneCollisions = true;
}

Now I noticed some odd behaviour when debugging. When I called Thread.SetAffinity, it sort of jumped back to it over and over once or twice before finally starting to actually check the collisions.

And now my collisions are delayed by 5-10 seconds…

If anyone has insight please input some 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-11T04:04:54+00:00Added an answer on June 11, 2026 at 4:04 am

    The XBOX 360 has 3 cores with 2 hardware threads per core, producing a total of 6 hardware threads.
    Threads 0 and 2 are reserved by the XNA Framework, leaving 1, 3, 4 and 5 for you to use.

    As for the question, why are you creating a new thread after checking for collisions, to do exactly the same all over again? If you need to repeat the collision checking in a thread, simply put it inside a while(true) loop to keep it going.

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

Sidebar

Related Questions

I have a very simple windows Service that is developed in vb.net 2008. When
a very puzzling and exhausting problem of mine: I developed an API to allow
i developed a very simple vb.net application and i need a way for every
I've developed a very simple host and client which I wanted to use to
I've developed a very simple ASP.NET (jQuery) application. The RDBMS is MS Sql Server
I've developed a small (very small) ftp client and server. Both of these programs
I'm very newbie to Ubuntu OS and I have my solution developed in visual
I am very new to iPhone. I have developed two version of an application
I have developed an AJAX based game where there is a bug caused (very
I have developed a simple location aware iPhone application which is functionally working very

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.