[PATCH] D114183: [ThreadPool] Add template argument for future result type.
Mehdi AMINI via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 19 13:50:46 PST 2021
mehdi_amini added a comment.
In D114183#3143852 <https://reviews.llvm.org/D114183#3143852>, @fhahn wrote:
> In D114183#3143742 <https://reviews.llvm.org/D114183#3143742>, @mehdi_amini wrote:
>
>> This seems like a bit of a "niche" extension: it makes it possible to return future but only for a statically predefined type. Is there a way to type-erase this in the threadpool a bit better and manager this at "enqueue time" instead so that each new task can return its own future?
>>
>> Also isn't this feature something that can likely be layered on top of the existing ThreadPool without changing it?
>> For example by wrapping the submitted task into another object that manages the promise/future.
>
> I think that's what Michael was asking/suggestion in the previous comment :)
Ah, I missed this! I think skimming at the link Michael provided, the `ScheduleAndGetFuture` is what I had in mind.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114183/new/
https://reviews.llvm.org/D114183
More information about the llvm-commits
mailing list