mina-sshd icon indicating copy to clipboard operation
mina-sshd copied to clipboard

Adding Project Loom Support

Open dspangen opened this issue 1 year ago • 1 comments

Description

Hi, I noticed there are quite a few uses of spinlocks (synchronized usage) within mina. Are there any plans to replace these with ResourceLocks to prevent thread pinning (as discussed in JEP-444)? Without it, it's not reasonable to use mina with virtual threads in all cases.

Motivation

Scalability

Alternatives considered

No response

Additional context

No response

dspangen avatar Apr 05 '24 20:04 dspangen

No, there are currently no such plans. Also from JEP-444:

In a future release we may be able to remove the first limitation above, namely pinning inside synchronized.

Object monitors are a very useful language feature; replacing them all by ReentrantLocks will complicate the code and reduce its readability considerably and gives rise to new possibilities to make mistakes.

Apache MINA SSHD is built on the asynchronous I/O model; it's not clear to me how easy or complicated it might be to adapt it to virtual threads such that it actually benefits from them.

tomaswolf avatar Apr 08 '24 08:04 tomaswolf