CHERIoT-Platform / CHERIoT-Platform/network-stack
Make the network stack API multiwaiter-compatible
- Dominant language
- C++
- Stars
- 9
- Forks
- 14
- Avg merge
- 6d 17h
- Merged PRs (30d)
- 1
Description
The [multiwait](https://github.com/CHERIoT-Platform/cheriot-rtos/blob/main/sdk/core/scheduler/multiwait.h) API allows a waiter to wait on multiple events.
It would be very useful if we could make the network API compatible with this API so that a thread can wait on several socket receives, accepts, etc. Callers currently need to create multiple threads to do this. This would be the equivalent of poll or select.
To make the network stack API multiwaiter-compatible, we need to expose a futex.
A few locations where adding this futex would make sense (to be edited when new ideas come):
- receive bytes: `network_socket_receive`, `network_socket_receive_preallocated`, `network_socket_receive_from`, and the TLS equivalents `tls_connection_receive_preallocated`, `tls_connection_receive`
- send bytes: `network_socket_send`, `network_socket_send_to`, and the TLS equivalent `tls_connection_send`
- connect to a remote host: `network_socket_connect_tcp`
- accept a connection: `network_socket_accept_tcp` in the new server API (https://github.com/CHERIoT-Platform/network-stack/pull/39)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with sdk/core/scheduler/multiwait.h to understand the multiwait API, then inspect the listed network_socket and tls_connection receive, send, connect, and accept entry points. Determine where each operation can expose a futex, including the new server API's network_socket_accept_tcp. Done means callers can wait on multiple socket operations through the multiwait interface without creating separate threads.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- networking
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100