agraubert/agutil

Make the High-level security interface parallelized

Closed this issue · 1 comments

Until I have a proper name for the new interface, I'm just going to call it Security. So each Security instance should maintain a single worker thread, which listens for incoming commands, and spawns new threads to deal with them. Each thread can operate in parallel with the exception that each channel can only perform one operation at a time (ie: if two threads are performing commands on one channel, one of them must wait until the other completes). The user interface will enqueue new commands to the worker thread (when sending data) and block until incoming data is made available from the pool of command threads

As part of this overhaul I'm going to remove the 'channel' functionality of the Security class. To maximize parallelization, connected sockets will reserve a new channel for each task, which will be used for the underlying QueuedSocket, but not seen by the user. In this way, the user is simply sending and receiving text and files while the implementation layer determines how to get the data there.