-
Notifications
You must be signed in to change notification settings - Fork 7
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
API for event loop integration #74
Comments
libzmq uses a different approach which hides the library's file descriptors and other event sources behind a "mailbox fd" that becomes readable when the host event loop should unblock and test for events to process. I believe this requires the library to spawn a separate event loop in another thread that can unblock on its own, handle events, and then signal the mailbox. (libzmq does spawn this "service thread") libzmq chose to "edge trigger" this mailbox, which creates some headaches for event loop integration. In flux-core we followed the pattern outlined in the following blogs to make it work: https://funcptr.net/2012/09/10/zeromq---edge-triggered-notification/ |
Couple of notes from discussion yesterday plus some thoughts:
Here's the GSSAPI ref since it's potentially another example of a "sufficient" API for event loop integration: In the GSSAPI example, the functions are split into halves that produce and consume buffers, and wire communication is left to the user, e.g. (error code dropped): s = connect_to_server(host, port); // user-provided synchronous connect
// snip - other init details (no I/O on s though, pretty sure)
gss_wrap(&min_stat, context, 1, GSS_C_QOP_DEFAULT, &in_buf, &state, &out_buf);
send_token(s, &out_buf); // user-provided synchronous send of full buffer
recv_token(s, &out_buf); // user-provided synchronous recv of buffer until EOF
gss_verify_mic(&min_stat, context, &in_buf, &out_buf, &qop_state); I'm not sure how you would build an API like that for a function like |
As noted in flux-framework/flux-core#1543,
flux_sign_wrap()
andflux_sign_unwrap()
may, depending on selected mechanism, internally perform synchronous communication with outside processes / daemons. For example, when configured to use MUNGE, both wrap and unwrap exchange messages with the munge daemon. When configured to use curve, unwrap performs a fork/exec/wait on the IMP, and exchanges messages via stdin/stdout.It is desirable to allow the security API to be integrated into event driven programs, such as flux-core comms modules, without introducing blocking behavior, as this limits scalability and reduces responsiveness.
See the adio example in the libev manual for one approach.
The text was updated successfully, but these errors were encountered: