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

Please document how concurrency is handled #24

Open
pavlix opened this issue Oct 29, 2024 · 2 comments
Open

Please document how concurrency is handled #24

pavlix opened this issue Oct 29, 2024 · 2 comments

Comments

@pavlix
Copy link

pavlix commented Oct 29, 2024

It would be great if it was documented how concurrent requests, especially when Tokio is used, are handled for netlink-proto and also rtnetlink, for that matter. How simultaneous request-response exchanges are handled and dispatched and how event monitoring is done simultaneously with request-response exchanges. It would help to know what we can rely on and what we cannot.

@cathay4t
Copy link
Member

You should not use single rtnetlink::new_connection() to host simultaneous request-response exchanges. You can only send out request after reply done or error.

Please create multiple rtnetlink::new_connection() for your use case.

For event monitoring, the rtnetlink/examples/ip_monitor.rs can helps.

@cathay4t
Copy link
Member

In theory, rtnetlink crate and kernel code have sequence number to track multiple communication session for a single socket(connection), but I would not suggest so as it might easily overflow the netlink socket buffer especially with BGP routes.

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

No branches or pull requests

2 participants