Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider edm::async() #29188

Closed
makortel opened this issue Mar 11, 2020 · 9 comments · Fixed by #44901
Closed

Consider edm::async() #29188

makortel opened this issue Mar 11, 2020 · 9 comments · Fixed by #44901

Comments

@makortel
Copy link
Contributor

PR #29141 uses mostly-sleeping threads to achieve "pseudo asynchronous" behavior with RPC API's that do not provide fully asynchronous API (thread does the remote calls, then blocks the thread to wait for response, and after waking up notifies the edm::WaitingTaskWithArenaHolder that the work is done). If the use such threads starts to spread (more classes, more modules), it could be beneficial to abstract that behavior.

In a sense std::async() does the job, except

  • thread behavior is unspecified (create+join every time vs pool)
  • returns a future with which one can either query the state, or block the calling thread
    • Concurrency TS adds continuation passing which is the behavior we want

One option would be to create edm::async() that uses a specific thread pool to minimize thread creation and joining, and continuation passing (e.g. requiring edm::WaitingTaskWithArenaHolder be passed around).

@cmsbuild
Copy link
Contributor

A new Issue was created by @makortel Matti Kortelainen.

@Dr15Jones, @smuzaffar, @silviodonato, @makortel, @davidlange6, @fabiocos can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@makortel
Copy link
Contributor Author

assign core

@cmsbuild
Copy link
Contributor

New categories assigned: core

@Dr15Jones,@smuzaffar,@makortel you have been requested to review this Pull request/Issue and eventually sign? Thanks

@fwyzard
Copy link
Contributor

fwyzard commented Mar 11, 2020

Would that need a Service to own the thread pool ?

@makortel
Copy link
Contributor Author

I haven't managed to come up with a better solution than a Service or a singleton object for a "nice" API, and that is the part I don't like that much.

@makortel
Copy link
Contributor Author

makortel commented May 3, 2024

Implemented in #44901

@cmsbuild
Copy link
Contributor

cmsbuild commented May 3, 2024

cms-bot internal usage

@makortel
Copy link
Contributor Author

makortel commented Jun 6, 2024

+core

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 6, 2024

This issue is fully signed and ready to be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants