Q: Take advantage of 64bit processor in c#

  • Thread starter Thread starter Martin Arvidsson, Visual Systems AB
  • Start date Start date
M

Martin Arvidsson, Visual Systems AB

Hi!

I have been doing a project in c# a while back, now my customer whant's me
to
upgrade the software so it can handle dual or quad processors and use the
full power of 64bit processor.

Is it possible to do this in c# or do i need to reprogram my software in
c++?

Any links, tips, help would be greatfully appreciated.

Regards
Martin, Data Martin - Sweden
 
Martin Arvidsson said:
I have been doing a project in c# a while back, now my customer whant's me
to
upgrade the software so it can handle dual or quad processors and use the
full power of 64bit processor.

Is it possible to do this in c#

It's automatic, you don't have to do anything. If you are using the
default compiler options, you will generate an executable file which
actually contains MSIL code that targets "Any CPU". This MSIL code, when run
on a 64 bit operating system, will be converted by the JIT-compiler into
64-bit code, so your C# program will be running in 64 bits and taking
advantage of the processor. This means, for example, that your code will be
able to allocate objects which are larger than 2 gigabytes.

If you want to take advantage of a quad processor, your code will need
spawn at least four threads, and divide its work among those threads. Doing
this is, in general, far from tirvial, and will depend heavily on what your
program is trying to accomplish.
 
Perhaps you could try looking at the Parallel extensions, this library makes
it an almost trivial task to implementing your concurrent solution.

Obviously, care needs to be taken when considering what can be parallelised
(if there even is such a word), and you will have to look at the general
architecture for your application. :o)
 
Back
Top