I am writing a compiler for the D language. I also just got the CPU for my new machine; a quad-core.
These two facts got me thinking about multi-threaded builds. How are they done? I know I can multithread (well, multiprocess), say, building NetHack by using make(1)'s `-j` switch, which starts multiple jobs up and GCC has no involvement in the simultaneous compilation. How is this done in the Windows/Visual Studio world? Is it built into the compiler, or a tool external to the compiler, as with make(1)? Is there a compiler that does have this built in? Have you used it?
If you were me, what would you do? Build it in, or leave it out? Leaving it out would seem to me to duplicate work. If two modules have
then the package foo is searched for a module bar, which is then lexed, parsed, and all the public top-level declarations are pulled out for use. That only has to be done once, but if multicompilation is achieved by multiple instances of the compiler, it has to be done anew in each module.
I don't know much about concurrent programming really, or compiler writing, so I thought I'd start a discussion here -- what do you think?
These two facts got me thinking about multi-threaded builds. How are they done? I know I can multithread (well, multiprocess), say, building NetHack by using make(1)'s `-j` switch, which starts multiple jobs up and GCC has no involvement in the simultaneous compilation. How is this done in the Windows/Visual Studio world? Is it built into the compiler, or a tool external to the compiler, as with make(1)? Is there a compiler that does have this built in? Have you used it?
If you were me, what would you do? Build it in, or leave it out? Leaving it out would seem to me to duplicate work. If two modules have
Code:
import foo.bar;
then the package foo is searched for a module bar, which is then lexed, parsed, and all the public top-level declarations are pulled out for use. That only has to be done once, but if multicompilation is achieved by multiple instances of the compiler, it has to be done anew in each module.
I don't know much about concurrent programming really, or compiler writing, so I thought I'd start a discussion here -- what do you think?