-
Notifications
You must be signed in to change notification settings - Fork 5
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
Async external events support #22
Comments
Hi @mryndzionek . For clarity, can you share a small example of a program that uses this kind of external event? |
Hello @tomyaacov, I've found some more info regarding this in different papers. Here is no quote:
And another one:
I started developing my own "toy" BP framework in C. Here is how I call the "external event" callback: https://github.com/mryndzionek/toy_bp_c/blob/main/src/bp.c#L207 |
Thanks, @mryndzionek, that's clearer now. I agree that this is an important feature we should add. However, I'm not sure how the callback solution you mentioned works. If you have an idea in mind so maybe you can PR and we can start collaborating on some solution. Also, I looked at solutions from BPjs, where the b-program has a "WaitForExternalEvents" flag. Maybe we can draw a solution from there. Regarding the C implementation, are you familiar with BPC? I haven't tried it, and I'm not sure it is currently supported, but you should check it out if you haven't. |
After looking at BPpy a little bit more it seems the focus is more on verification and model checking, so maybe adding a "real time" engine like this is an overkill? The main issue I see is how to efficiently determine if there are only
yeah, "WaitForExternalEvents" is just a way on enabling the functionality. The functionality itself seems to be what I have in mind and hinges on detecting when the superstep ends (as mentioned above).
Yes, I've seen BPC, however I would like to have something in pure C and something that doesn't use OS-thread per b-thread (and therefore uses cooperative concurrency). |
Hello,
Would it be possible to add more generic support for external events? I tried to hook-up timer events based on epoll and timerfd. It seems however that the method showed in the
external_events.py
doesn't work for purely async events (e.g. for bthreads that start just waiting for an async event, etc). There is no way then to tell when to send anIdle
event. Would it be possible to add a callback run here? Then also the bthread ending detection would have to be adjusted (i.e. based on the generator/continuation actually ending, not the absence of events).The text was updated successfully, but these errors were encountered: