Author Topic: Parallel build doesn't honour priority  (Read 8524 times)

Offline sodev

  • Regular
  • ***
  • Posts: 497
Parallel build doesn't honour priority
« on: October 05, 2012, 07:09:14 pm »
I'm using compile priorities to ensure that my precompiled header gets compiled before it is needed (i'm using codeblocks with the visual studio compiler so i need to compile a dummy cpp file to create my precompiled header), while this works without any problem when i'm using only one thread it fails when i'm using multiple build threads. The problem is that while the system that feeds the build threads processes the files in the specified compile order it however does not wait until all files of one priority level are finished, so it happens that files with a different priority level get compiled at the same time.

After digging around the sources i think the best way to solve this is to add a WAIT command when the priority value changes during the creation of the list of the build commands, like its already done for the PCH-feature and the generated files. I have submitted patch #3342 that does this, i am not sure if it does any harm if there are two consecutive WAIT commands in the list, thats why i added a check to test if the last command is already a WAIT, but see the comment in the patch.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Parallel build doesn't honour priority
« Reply #1 on: October 05, 2012, 07:59:52 pm »
That sounds interesting, indeed. I am currently limited in time, but once I have some more spare time, I'll look into it. But maybe another dev picks this one up before me....
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ