On Thu, 9 Apr 2026 09:56:57 GMT, Viktor Klang <[email protected]> wrote:

>> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1298:
>> 
>>> 1296:                 if (room < 0)
>>> 1297:                     throw new RejectedExecutionException("Queue 
>>> capacity exceeded");
>>> 1298:                 if ((room == 0 || room == m ||
>> 
>> Not that it would make any visible difference, but I guess we could 
>> eliminate one conditional by doing something like `(room | m) == m`?
>
> Note that the aforementioned won't work.

I took a bunch of different approaches for a spin, and the best I can do to 
avoid an additional branch is to not use a short-circuiting OR and instead do 
`(room == 0 | room == m)`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28797#discussion_r3060871574

Reply via email to