9
\$\begingroup\$

I would like to implement threading in my XNA game but I'm not sure how things work when compiling for the XBOX 360. Could someone elaborate on this?

For example, how many threads does XBOX support? I realize that XNA uses a special version of the Compact Framework. How does this affect the code during development? Do I implement things differently when developing for XBOX than Windows?

Thank you.

\$\endgroup\$
13
\$\begingroup\$

Basicly, the xbox 360 has 6 hardware threads, spread over 3 cores. Two of these are reserved for the xna framework and general system use. Threading works the same as it does on the .net framework on windows,except you get an extra methods, SetProcessorAffinity. Unlike windows, the xbox dosnt do any fancy thread scheduling for you, so you have to tell it what hardware thread to run your thread on.

There are some good xbox aware thread pools out there, have a look on google if you need some example code, but if your confident with threading in windows that msdn page should give you all you need.

\$\endgroup\$
  • 3
    \$\begingroup\$ Exactly. Just to complete the picture the threads are distributed as follows: RHRHCH. R = Reserved for XNA. H = 'Hyperthreaded' core. C = Physical core \$\endgroup\$ – Jonathan Dickinson Aug 11 '10 at 15:39
  • \$\begingroup\$ I wouldn't call the two hardware threads per core "physical" versus "hyperthreaded" due to how the technology differs from the Intel implementation: arstechnica.com/old/content/2005/06/xbox360-2.ars \$\endgroup\$ – Oskar Duveborn Oct 8 '11 at 21:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.