Hey Daryl,
We should never allow two threads into user code at the same time,
although you could potentially get into a situation where you're
interleaving calls to actions and property getters. We synchronize the
page rendering on the controller instance; see PageFlowPageFilter:284.
Let me know if you see any issues with this, though.
Rich
Daryl Olander wrote:
Rich, I'd love some confirmation of the following if you can,
I'm in the process of looking at some issue with the BeanContext and Control
use in NetUI and I have a question about threading. I believe that we make
the statement that PageFlow are single threaded. The issue is that I
believe we in fact allow more than one thread into a page flow. Here is an
example of where I think it can happen.
If you have a set of frames on a page, all making requests to the same page
flow, they will serialize access to the actions in the page flow. When the
first thread finishes the action and forwards to a JSP, the second thread is
allowed access to the page flow. This is the reason we say things are
single threaded. The problem is that if the JSP takes a while to run and it
databinds to properties on the page flow you can have multiple threads
running through the page flow. The first thread is calling property getters
while rendering the JSP and the second thread is running an action. This is
actually not uncommon if the property being accessed calls a control that
accesses an external resource like a database.
Rich, can you comment on this? Is there something else that prevents
multiple threads from entering a page flow?