The main idea behind is to be able to have more than one IOLoop thread running in the JVM, so Defft can use every single core or CPU of the hosting system. I did something like that in my forked project.
I see two orientation for this:
- One infinite loop using a selector to listen for incoming request (accept) and pushing accepted sockets to one or more infinite thread loop. This is what I did in my fork . The infinite thread loop use another selector to handle read, write and all other operations, so channel events are still executed in the same single thread.
- One selector holding listening sockets is shared between multiple infinite IOLoop threads. Each IOLoop hold its own selector for read and write operations. There should be a lock on the shared selector but this may be easier to develop.
My purpose is to allow Deft to execute on all available CPU cores without breaking the infinite loop philosophy.