Project: clover
Issue CLOV-1267: Check how parallel instrumentation can be handled
External build supports parallel compilation. Modules are built in parallel, while files in a single module are compiled sequentially. Clover expects that at least a single file is instrumented sequentially (the FileInto getCoverageMask which returns bitmask based on index range), so that the clover database contains continuous range of indexes for code elements from a single file. It means that we need to synchronize per file. It should not be a problem that subsequent files in database are from different modules. possible solutions: 1) simple lock per whole file in some synchronized block; drawback: turns parallel build into single-threaded one. 2) batch operations, like first instrument whole file using relative indexes, next lock database and store information about whole file, database would return base offset value; still in sychronized block but locked for shorter amount of time; 3) change clover.db structure so that elements could be registered in any order; change FileInfo getCoverageMask function (and related); check for any data structures which needs to be made thread-safe;
Story points: 8