Tuesday, June 4, 2013

Are portlets synchronized by default?

Portlets are multithreaded; each request received by the portlet container is executed
in a different thread, and at a given time it’s possible that multiple threads are accessing
a portlet instance. It’s the portlet developer’s responsibility to design portlets that
can handle concurrent requests.


When designing portlets, you should synchronize access to shared mutable resources, like mutable instance variables, to address multithreading issues.

No comments:

Post a Comment