This is the mail archive of the
mailing list for the binutils project.
Re: [GOLD] add new method for computing a build ID
- From: Ian Lance Taylor <iant at google dot com>
- To: gpike at chromium dot org
- Cc: binutils at sourceware dot org
- Date: Wed, 3 Oct 2012 17:07:15 -0700
- Subject: Re: [GOLD] add new method for computing a build ID
- References: <20121003192017.342EF1E0A04@geoffp.mtv.corp.google.com>
On Wed, Oct 3, 2012 at 12:20 PM, <email@example.com> 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