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

Work waiting on pollable objects #10748

Closed
pdunaj opened this issue Oct 22, 2018 · 2 comments · Fixed by #14041
Closed

Work waiting on pollable objects #10748

pdunaj opened this issue Oct 22, 2018 · 2 comments · Fixed by #14041
Assignees
Labels
area: Kernel Feature Request A request for a new feature

Comments

@pdunaj
Copy link
Collaborator

pdunaj commented Oct 22, 2018

At the moment Zephyr has two kinds of works - executed straightaway or executed with delay. It would be useful to have a third kind in which work would be executed when specific pollable object is ready (or any from a given list).

This way one could avoid creating a new thread to wait for some blocking API to become ready. Since creation of a thread costs RAM it may be to expensive to create many threads for every small task that use blocking read or something similar.

This could be solved by creating a dedicated thread that waits for any of the registered objects and when ready submit an associated work.
Or this could be hooked right into the scheduler - when object is ready and there is any work associated with it, such work would be submitted for execution.

@pfalcon
Copy link
Contributor

pfalcon commented Oct 22, 2018

Somehow, "This way one could avoid creating a new thread" and "This could be solved by creating a dedicated thread" together don't ring well to me.

But anyway, if you think it's useful for your needs, why don't you try to prototype it, and then see if it's really useful to become a generic facility of kernel (that's my understanding is what you propose; and that likely would require major changes to the "prototype" to turn it into fully general and bug-free facility).

Or this could be hooked right into the scheduler

No please. We have had enough bugs in the scheduler, and still have more, so loading it up with more arguably adhoc features doesn't sound cheerful at all.

@pfalcon pfalcon added Feature Request A request for a new feature area: Kernel labels Oct 22, 2018
@pdunaj
Copy link
Collaborator Author

pdunaj commented Oct 23, 2018

Hi @pfalcon

together don't ring well to me.

If you need to block in one place it would be no problem. If you need to block in 10 places it is a problem and this is what I refer to.

why don't you try to prototype it

I will once I have a bit of time. Maybe somebody else will also fine the idea useful and do it earlier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Kernel Feature Request A request for a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants