Closed PatrickPradier closed 5 years ago
Hi,
The SameThreadIOStrategy means that the selector thread that is bound to that socket will process the request. With the number of selector threads you specify how many threads are used to handle network requests. While a single selector thread can process multiple connections, a connection is always processed by the same thread.
IOW, it works as expected.
Thanks for your answer, so I'll stick with a WorkerThreadIoStrategy.
Hello,
I'm launching a custom nfs server with nfs4j. I wanted to build the RPC service with a "same thread IO strategy" because according to the grizzly documentation (https://javaee.github.io/grizzly/iostrategies.html), it could be the most efficient strategy. However, when specifying a number of selector thread in the builder, it seems that only one thread is used to process incoming requests on my nfs server.
Here is how I instantiate the RPC service :
rpcService = new OncRpcSvcBuilder().withPort(6115).withTCP().withAutoPublish().withSameThreadIoStrategy() .withSelectorThreadPoolSize(8).withServiceName("test_service").build();
And in the logs I only see one thread (test_service:6115 (2) SelectorRunner):
[2019-04-05 07:33:59,443][INFO ] LOOKUP : .xdg-volume-info (MyVirtualFilesystem.java:113 - test_service:6115 (2) SelectorRunner)
[2019-04-05 07:33:59,443][INFO ] LOOKUP : .autorun.inf (MyVirtualFilesystem.java:113 - test_service:6115 (2) SelectorRunner)
[2019-04-05 07:33:59,443][INFO ] LOOKUP : .Trash (MyVirtualFilesystem.java:113 - test_service:6115 (2) SelectorRunner)
Maybe I'm doing something wrong ?