[undertow-dev] Threading model used for handler processing.

Stuart Douglas sdouglas at redhat.com
Mon Feb 1 22:38:22 EST 2016


A single handler is shared by all threads (in much the same way as Servlet's). If a handler has any form of mutable state it needs to be thread safe.

Stuart

----- Original Message -----
> From: "Jason Kania" <jason.kania at ymail.com>
> To: undertow-dev at lists.jboss.org
> Sent: Tuesday, 2 February, 2016 12:41:03 PM
> Subject: [undertow-dev] Threading model used for handler processing.
> 
> Hi,
> 
> I am trying to create what I call a URL mapping handler that maps path and
> query variables from the http request to java method parameters via
> annotations. It is a bit like what Spring or JAX-RS does. The intent is to
> reduce a bunch of the boilerplate associated with validation of incoming
> requests, but nothing more than that.
> 
> One of the stumbling blocks I have come upon is threading model used in
> calling handlers. I am trying to understand if
> 1) there is only meant to be a single handler shared by multiple threads such
> that it must handle multithreading
> 2) the handler instances are somehow cloned.
> 3) one handler is being assigned to a single thread at a time.
> 
> Without me diving into the code to figure this out, can someone please
> clarify this? To me this would be a good addition to the handler guide.
> 
> Thanks,
> 
> Jason
> 
> _______________________________________________
> undertow-dev mailing list
> undertow-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev


More information about the undertow-dev mailing list