-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved documentation about virtual threads. #8900
Improved documentation about virtual threads. #8900
Conversation
...tation/jetty-documentation/src/main/asciidoc/operations-guide/modules/module-threadpool.adoc
Outdated
Show resolved
Hide resolved
documentation/jetty-documentation/src/main/asciidoc/programming-guide/arch-threads.adoc
Outdated
Show resolved
Hide resolved
documentation/jetty-documentation/src/main/asciidoc/programming-guide/arch-threads.adoc
Show resolved
Hide resolved
documentation/jetty-documentation/src/main/asciidoc/programming-guide/arch-threads.adoc
Outdated
Show resolved
Hide resolved
documentation/jetty-documentation/src/main/asciidoc/programming-guide/arch-threads.adoc
Outdated
Show resolved
Hide resolved
Deciding between these two modes depends on whether there is a free thread immediately available to take over production, and this is captured by the `org.eclipse.jetty.util.thread.TryExecutor` interface. | ||
|
||
An implementation of `TryExecutor` could be asked whether it can immediately allocate a free thread to run a task, as opposed to a normal `Executor`, that can only queue the task in the hope that there will be a thread in the near future that could run the task. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If a task declares that it can run in either blocking or non blocking mode, then the strategy may choose to use Produce-Consume with the additional invocation flag to force non-blocking mode; or it may choose one of the other strategies used for blocking tasks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left this out on purpose to avoid to go too deep into the implementation details.
For example, I do not mention the EITHER invocation type, the PRODUCE_INVOKE_CONSUME mode, etc.
For now I'd leave it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is important to add at least a small mention like this. Else it appears that the documentation does not describe the actual implementation. It doesn't need a deep dive, just a mention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your suggestion is just too obscure for those that don't know the implementation.
99.999% of usages will be either blocking or non-blocking, "either" is really for super-special cases and if a developer is there, reading the code/javadocs is better than reading the documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think that EITHER and PIC needs to be mentioned somewhere in the doco, otherwise it looks like it is for a different version of the code.
documentation/jetty-documentation/src/main/asciidoc/programming-guide/arch-threads.adoc
Show resolved
Hide resolved
documentation/jetty-documentation/src/main/asciidoc/programming-guide/arch-threads.adoc
Outdated
Show resolved
Hide resolved
documentation/jetty-documentation/src/main/asciidoc/programming-guide/arch-threads.adoc
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some questions
...tation/jetty-documentation/src/main/asciidoc/operations-guide/modules/module-threadpool.adoc
Show resolved
Hide resolved
documentation/jetty-documentation/src/main/asciidoc/programming-guide/arch-threads.adoc
Show resolved
Hide resolved
Added programming guide section about Jetty threading model. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
0980ca2
to
72d5367
Compare
Added programming guide section about Jetty threading model.
Signed-off-by: Simone Bordet simone.bordet@gmail.com