Skip to content
Snippets Groups Projects
Commit 797d931a authored by Marek Vavrusa's avatar Marek Vavrusa Committed by Gerrit Code Review
Browse files

Updated networking code.

- Simplified and decoupled I/O from processing code.
- Single reader with multiple workers.
- Reader is bound to specific CPU for lowest possible latency.
- Reverted to select() instead of fdset wrapper as epoll/kqueue could
  be quite slower for a single or handful of sockets.
- Reader I/O calls are non-blocking.

General idea is:
- Reader takes free request from a rx_queue
- Receives data and pushes it to the tx_queue
- Worker processes the packets, sends answers and returns the request
  to the rx_queue

Semi lock-free queue is used for communication.
This is measured to be slightly better than singlethreading, as socket
contention could be better predicted - the reader cannot check sockets
for new events when tx_queue is full.

Change-Id: Ifc40889b355404a9e78e10d77c26cb3fc4c58386
parent bbef208f
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment