Mutithreads handling

If a button gets continuously clicked many times, thread will be fired for each click to execute some logic.(in my vaadin app, it manipulates some session-based data.) My question is that can these threads be executing simultaneously or one has to wait to start until the other thread ends within the same session.



That depends :slight_smile: Most servlet containers (e.g. Tomcat, Jetty…) have e determined pool of threads that handle communication; these threads run concurrently and could in theory process multiple requests at once. But since Vaadin is stateful, and each request needs access to the state, Vaadin locks the session when executing a request. So, multiple sessions can run once but one Vaadin session can only run on one thread at a time.

Thanks Thomas. Got it.