Servlet 3.0 asynchronous

What's the diffrence between servlet 3.0 asynchronous feature against:

Оld servlet implementation:

doGet(request,response) {
Thread t = new Thread(new Runnable()
     void run(){
        // heavy processing
        response.write(result)
     }
}
t.start();

In servlet 3.0 if I waste a thread to do heavy processing - I earn one more thread in the container, but I waste it in heavy processing... :(

Could somebody help?

16
задан gstackoverflow 27 June 2019 в 21:00
поделиться