Single thread model

If a servlet implements interference for a single-thread model, how does the servlet container ensure that servlets only process one request at a time? Even the single-thread model interface also has no methods. Thanks.

+3
source share
3 answers

The servlet container creates a pool of servlet instances and keeps track of which instances are currently "in use". If all instances are “used” when a new request arrives, the container can either wait for the existing one to become free or create a new instance to process the request.

: .

+2

, SingleThreadModel, . singlethreadmodel, .

+1

Source: https://habr.com/ru/post/1704783/


All Articles