Software > Computer programming

How to try Project Loom and would Project Loom replace Threads in java.net.Serve

(1/1)

jenit739:
Hi
Scalability is OS-dependent as ServerSocket that handle multiple connections use Threads. In websocket, you would need 1 thread for 1 connection. In other words, scalability is bad if you use IO ServerSocket. Therefore, I believe most people would use NIO for the WebSocket server, but maybe stick with IO for HTTP server.
What do you think? Would porting to virtual threads e.g this snippet of code will be easy? `SessionHandler implements Runnable`.

```

SessionHandler handler = new SessionHandler(socket);

new Thread(handler).start();

Navigation

[0] Message Index

Go to full version