This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [GOLD] add new method for computing a build ID


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]