Showing posts with label XNA Optimization. Show all posts
Showing posts with label XNA Optimization. Show all posts

Multi-core in Xbox 360


Xbox 360 has 3 core composition which can use 6 hardware threads (HWT).
The number is shaken at HWT.

Core HWT Use
0 0 Use is impossible. System notice, Transformer port, Service.
0 1 Use is possible. Game main thread, GSE host, .NetCF.
1 2 Use is impossible. Asynchronous Xbox 360 content operation.
1 3 Use is possible. Xbox 360 guide, Dashboard.
2 4 Use is possible. Xbox Live market place download.
2 5 Use is possible. Xbox 360 guide, Dashboard.

Thread.SetProcessorAffinity method is used for assignment of HWT.
However, since only assignment of the thread under execution can do this method now, it is necessary to specify it as the beginning of the entry point of a thread.
The technique of the multithread of C#/.NET can be used as it is.

Reference
Higeneko diary

Inline method by XNA on Xbox 360


The inline method which mitigates the overhead of a call of a method.
JIT forms into an inline what fulfills the following conditions.
  • The IL code size is 16 bytes or less.
  • The branch command is not used (if sentence etc.).
  • The local variable is not used.
  • Exception handling has not been carried out (try, catch, etc.).
  • float is not used as the argument or return value of a method (probably by the Xbox 360, not applied).
  • When two or more arguments are in a method, it uses for the turn declared.
However, a virtual function is not formed into an inline.

Reference
Higeneko diary