-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Refactor threaded mode to remove non-block sockets and related hacky code.
If a single I/O task is kept, non-block sockets can be replaced by select or poll (on Linux). On RTEMS, it's acceptable to only support select with it's 64 max FDs, since we shouldn't have many open FDs to begin with.
A better solution would be to split the I/O task into an 'I' and 'O' tasks instead of being one combined task. On RTEMS, this will increase resource usage, but we use single threaded mode there anyways (at least by default).
- 'I' task: Receives data in a loop and services requests
- 'O' task: Receives data from the message queue, sends it, inserts into known message list
Since the TCP/IP stack is full duplex, it should be safe to send/recv from different threads.
This will also allow us to remove the hacky logic using the RTEMS 'wake on data available' feature.