[GOLD] add new method for computing a build ID

Ian Lance Taylor iant@google.com
Thu Oct 4 00:07:00 GMT 2012


On Wed, Oct 3, 2012 at 12:20 PM,  <gpike@chromium.org> wrote:
>
> The patch adds a new mathematical function for build ID, in addition
> to the two that are available now (SHA-1 and MD5). The new function
> does MD5 on chunks of the output file and then does SHA-1 on the MD5
> hashes of the chunks. This is easy to parallelize.

The parallelization code looks plausible at first glance, but it's not
the way gold threads work.

The gold way is to split up the work into multiple units.  Create a
blocker (via Task_token(true)).  Add the number of units to the
blocker.  For each unit, queue up a task to process that unit.  Each
of those tasks should return the blocker in the locks method.  Queue
up one final task to write out the hash value.  That final task should
check the blocker in its is_runnable method.  Then let the workqueue
run.

Ian



More information about the Binutils mailing list