KIST Implementation
This is the parent high level ticket for the implementation of KIST along a useful followup paper for extra information learned after the C-tor implementation.
We are faced with a big problem which is that C-tor KIST implementation is using a single thread main loop to handle all channels in order to prioritize them.
Arti has an async design of one channel per task which are independent from each other. Bringing a synchronization point for channel prioritization here would mean another layer after the channel reactor to be able to prioritize which channel gets to go on the wire first.
At this present time, we believe that going in that direction would be too much. Instead, we will take an incremental approach and start with the main goal of KIST that is to avoid buffer bloating. Meaning, each channel reactor will implement KIST in order to know if they can write or not on the socket.
As for overall channel prioritization, we'll leave this as a second possible round of work to evaluate if necessary and if yes, how.
There are still a series of challenges here to solve but they will be highlighted in the work items.
C-tor reference: src/core/or/scheduler_kist.c