[SERVER-42450] ExecutorFuture::thenRunOn should not getAsync() on same executor Created: 26/Jul/19  Updated: 08/Jan/24  Resolved: 29/Jul/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Benjamin Caimano (Inactive) Assignee: Benjamin Caimano (Inactive)
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: Service Arch 2019-08-12
Participants:

 Description   

The current thenRunOn() is a strict passthru to SemiFuture::thenRunOn(). If we compare against the _exec member, then we can potentially continue to run inline if the future is already on that executor.



 Comments   
Comment by Benjamin Caimano (Inactive) [ 29/Jul/19 ]

Turns out the ExecutorFuture scheme was more efficient then I thought it was. Each then() call is actually the point of schedule, so there are no additional getAsync() to worry about. A weird side effect of this is that one can theoretically be done working on a then() chain before a thenRunOn() even occurs.

Generated at Thu Feb 08 05:00:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.