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

Return the number of ongoing tasks from device_poll #1203

Closed
lucacasonato opened this issue Feb 8, 2021 · 1 comment
Closed

Return the number of ongoing tasks from device_poll #1203

lucacasonato opened this issue Feb 8, 2021 · 1 comment
Labels
area: ecosystem Help the connected projects grow and prosper help required We need community help to make this happen. type: enhancement New feature or request

Comments

@lucacasonato
Copy link
Contributor

Is your feature request related to a problem? Please describe.

It is currently difficult to efficiently poll the device to resolve pending task by dispatching callbacks (in a non-blocking fashion). In the ideal scenario you would only poll the device when a pending task is ready. This is not really possible because you don't know when a task is ready until you actually poll it (duh), or if the wgpu backend could somehow notify you if the task is completed (don't know how this would be implemented).

The next best thing is to poll only while you know there are ongoing tasks. The most effective way of doing this would be to start polling in some sort of loop until all pending tasks are done. Currently there is no easy way to tell that there are still pending tasks.

Describe the solution you'd like

device_poll should return the number of still pending tasks, or return a boolean specifying if there are still pending tasks.

Additional context

Related discussion on matrix: https://matrix.to/#/!XFRnMvAfptAHthwBCx:matrix.org/$6OXPFIL3wD2t0dWy-RsngKOkTiJ7f3iBtZtKCWV87tw?via=matrix.org

@kvark kvark added area: ecosystem Help the connected projects grow and prosper help required We need community help to make this happen. type: enhancement New feature or request labels Feb 9, 2021
@cwfitzgerald
Copy link
Member

There's been some discussion about how to do this and we actually do now return a boolean. That boolean isn't enough though, as the boolean can race against submit and lose. But now the #2700 is in, you can monitor all submissions, then wait for the least-recently-submitted one, to get the quickest resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: ecosystem Help the connected projects grow and prosper help required We need community help to make this happen. type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants