locked
Support for dual core and dual CPU RRS feed

  • Question

  • When does Microsoft plan to add support for dual core and dual cpu when compiling C++ code?

    I was asking the same question 8 years ao when I got my first dual CPU machine.
    Did not get any answer.

    Distributed compilation like Incredibuild would also be nice to have.

    Regards
    Lars Schouw

    Thursday, December 29, 2005 5:45 AM

Answers

  • In VC2005 you can build multiple projects at the same time. http://msdn2.microsoft.com/en-us/library/9h3z1a69.aspx contains more details.

    Also, there are some future work currently in progress. Please see Herb's talk about concur at http://www.gotw.ca/

    Thanks,
    Ayman Shoukry
    VC++ Team
    Friday, December 30, 2005 7:47 AM
  • this is an undocumented complier flag. And I can only find the following statement related to it "operation is incompatible with multiprocessing; ignoring /MP switch". It seems like a nice switch
    Tuesday, January 24, 2006 6:54 PM
  • And the real cool thing is the combination of multi-processor and existing parallel multi-project build support.  If you have an SLN with multiple projects in it, parallel multi project builds are enabled by default (you can see task manager running multiple CL processes to see that this is true).   So, now in combination with multi-processor support, for example with 4 CPUs (e.g. two dual core CPUs), you get up to 16 CL processes running in parallel! 

    Tuesday, January 24, 2006 7:05 PM

All replies

  • In VC2005 you can build multiple projects at the same time. http://msdn2.microsoft.com/en-us/library/9h3z1a69.aspx contains more details.

    Also, there are some future work currently in progress. Please see Herb's talk about concur at http://www.gotw.ca/

    Thanks,
    Ayman Shoukry
    VC++ Team
    Friday, December 30, 2005 7:47 AM
  • Try rebuilding the C Runtime library using bldnt.cmd, and then watch your task manager process list for CL processes.  That's the only hint I'll give.
    Friday, December 30, 2005 3:29 PM
  • Happy new year

    Thank you AymanI could not find anything on Sutter's webpages.

    Building two projects at the same time it not enought, but thank you for poiting it out to me.

     I will stick with incredibuild for now.  http://www.xoreax.com

     Lars

    Tuesday, January 10, 2006 12:24 AM
  • Ted,

    Could you clarify this? Does this mean that you can only build two projects at the same time?

    Lars

    Monday, January 23, 2006 7:20 AM
  • There is a possibility that you can write a VS plug in that can manage dualCPU and assign tasks on both CPU's either by spliting the work in 2 parts or by making it possible to complile mutliple projects at a time( note that multiple is as many cpus you have ). The first approach is kinda complex. So I would stick to the second one.

    If you need some tips or so... don't hesitate to ask for them

    Monday, January 23, 2006 9:55 AM
  • ok this is killing me, take a look at the following file for another clue:

    \program files\microsoft visual studio 8\vc\crt\src\makefile.sub

    now guys, you are looking for a compiler option that will enable no-hassle multiple CPU support.  Does it exist?  Well, according to the above file, yes it does!  But don't tell anyone. 

     

    Tuesday, January 24, 2006 2:06 PM
  • Thanks Ted I will keep it quiet ;)

    Lars

    Tuesday, January 24, 2006 2:08 PM
  • haha!! yea it's like /* uncomment this line if you want to improve performance */ :P anyway... didn't know that ty for the tip anywayz
    Tuesday, January 24, 2006 5:59 PM
  • this is an undocumented complier flag. And I can only find the following statement related to it "operation is incompatible with multiprocessing; ignoring /MP switch". It seems like a nice switch
    Tuesday, January 24, 2006 6:54 PM
  • And the real cool thing is the combination of multi-processor and existing parallel multi-project build support.  If you have an SLN with multiple projects in it, parallel multi project builds are enabled by default (you can see task manager running multiple CL processes to see that this is true).   So, now in combination with multi-processor support, for example with 4 CPUs (e.g. two dual core CPUs), you get up to 16 CL processes running in parallel! 

    Tuesday, January 24, 2006 7:05 PM
  • /MP really made the compiler fly.... GREAT...

    One more realson to upgrade from my 2x CPU Xeon 3Ghz to

    2 x dual core dual. 16 way boxes are _still_ to expensive but that will change over the next few years.

    Lars

    Tuesday, January 24, 2006 11:59 PM
  • Next distrbuted builds and compilations would be nice like with incredibuild and distributed build under *nix and *inux

    Regards

    Wednesday, January 25, 2006 12:05 AM
  • Sometimes when using this switch, there are conflicts accessing some files simultaneously (e.g. like when generating imported COM TLH and TLI files you sometimes get a permission denied error) and have to start the build again, but I guess that's why it's undocumented and unsupported.
    Friday, May 26, 2006 4:09 PM
  •  Ted. wrote:

    ok this is killing me, take a look at the following file for another clue:

    \program files\microsoft visual studio 8\vc\crt\src\makefile.sub

    now guys, you are looking for a compiler option that will enable no-hassle multiple CPU support.  Does it exist?  Well, according to the above file, yes it does!  But don't tell anyone. 

     



    Excellent! Spent a day trying to script a makefile exporter for VS.05 only to have make -j2 die horribly. This is much better, so satisfying to see both cores maxxed out.

    Thanks Smile
    Thursday, August 30, 2007 11:11 AM
  •  

    Monday, November 5, 2007 10:15 PM
  •  

    Done !, Try MPCL ( http://www.todobits.es/mpcl.hml ) . It wil use all Cpus / Cores you want, It is a FREE plugin for Microsoft Visual C++ 2005.

     

    Tuesday, November 6, 2007 10:34 PM
  • R/
    hi
    I developed my project in vc++ 6 so how can I run my project in multi core computer and use all cores. now my project just use first core.
    Thanks
    Monday, May 25, 2009 11:11 AM
  • Use your favourite search engine to search for "multithreading c++" and you will get lots of articles and tutorials.
    Monday, May 25, 2009 3:58 PM