DESCRIPTION

Bug 473316 - Infinite loop in images renderer when few images

Take the ceiling of the division of threads among images so that, if the
number of images is fewer than half the number of threads, a batch size
of 1 (not 0) is used.

Avoid infinite loop when few images.

Change-Id: Id284414fc2f929ec1875109206799e87db1c36b9
Signed-off-by: Clayton Barron <Leon xxx@xxx.xxx


COMMENTS

author: Clayton Barron
date: 2015-07-23 17:21:33.000000000

Uploaded patch set 3.

-------------------------------------
author: Clayton Barron
date: 2015-07-23 17:23:34.000000000

Patch Set 3:

Ah yes, the old 'hopefully there are fewer than 100 fixes in the maintenance branch' strategy! ;-) I've just fixed that up.

-------------------------------------
author: Brenden Conley
date: 2015-07-23 17:59:37.000000000

Patch Set 3:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/6088/

-------------------------------------
author: Brenden Conley
date: 2015-07-23 18:27:25.000000000

Patch Set 3: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/6088/ : SUCCESS

-------------------------------------
author: Sebastian Porter
date: 2015-07-24 06:46:52.000000000

Patch Set 3: Code-Review-1 Verified+1

The proposed change "works", but it is a bit of an overkill to use doubles and ceil(). A simple Math.max(1, ...) would do the trick.

-------------------------------------
author: Clayton Barron
date: 2015-07-24 09:32:39.000000000

Patch Set 3:

@Dani - I'm not sure that's correct. Using ceil ensures that the correct number of jobs are chosen to dish out among the available threads. If we take the example of 31 icons and 16 threads, then using Math.max would result in 31 tasks being created, each with a batch size of 1 icon to deal with, instead of what we're aiming for which is 16 tasks of 2 icons each (bar one which has one icon).

-------------------------------------
author: Sebastian Porter
date: 2015-07-24 09:52:24.000000000

Patch Set 3:

I completely agree with you Ben, but strictly speaking this is an additional improvement which is not necessary to fix the reported bug.

I'm fine with this but then we should update the commit message.

-------------------------------------
author: Gerrit Code Review
date: 2015-07-24 10:19:09.000000000

Change has been successfully merged into the git repository by Sebastian Porter

-------------------------------------
