tmccombs/tls-listener

Question about Parallelism

Closed this issue · 6 comments

Sorry if this is another silly question, but I was wondering how the concurrency/parrallelism works.

I realise we are using FuturesUnordered to poll the accept handshakes - but as far as I understand while it will work concurrently, it will never perform any work in parrallel / on multiple CPU threads, since they are all part of the same "task".

Would it be a good idea to first spawn the futures so they can run as parallel tasks?

Hmm, I have an idea on how to address this, let me get back to you.

Well, I think #18 works. Unfortunately, it isn't as ergonomic as I'd like due to the inability of rust to infer the type parameters.

If you have any ideas on how to improve it, or better names for the method and types, I'd love to hear it.

It looks really good in my opinion, thank you! The only thing I might suggest is moving some of the structs into a seperate file (and exporting under the same namespace) since it becomes a bit tricky to navigate the code :)

Hi,
I think I may have discovered an issue with the current implemenation?
We seem to be doing timeout wrapped around the JoinHandle, does this mean that the underlying accept future will never timeout / can stay around forever ?
I think we need to do the timeout inside the task?

I think #22 might fix that.