My point is the work to allocate the next range shouldn't be on the currently active thread calling .generate(...). To minimize any pauses. The longevity of thread doing the allocation is besides the main point. I think the identifiers remaining in the range should be configurable to provide flexibility for tuning. With the default being as suggested half the total number in the range.
|