Skip to content

Refactor and clean out threaded mode #31

@JJL772

Description

@JJL772

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions