Java's servlet framework itself is multi-threaded, but this thread is started by the webserver for you, not by the user.
Generally speaking, if you handle network communication yourself, you need to do multi-threading processing yourself, or do background task processing, and you also need to do multi-threading processing yourself.
Java's servlet framework itself is multi-threaded, but this thread is started by the webserver for you, not by the user.
Generally speaking, if you handle network communication yourself, you need to do multi-threading processing yourself, or do background task processing, and you also need to do multi-threading processing yourself.
Main purpose of multithreading:
Do not block main thread tasks (background tasks)
Concurrency, improve throughput (network multi-threading)