> -----Original Message-----
> From: Abhishek Srivastava [mailto:[EMAIL PROTECTED]]
> And to make it thread safe I have use "synchronize" blocks of 
> code which can
> cause all the requests to get queued up. (Java has lock per object,
> therefore if my code had 2 synchronized blocks, then the 2nd 
> block would
> lock up even when the first one is being executed.)
> Isn't this bad for performance?

Right; you should ensure that your Action class does not define or use
instance variables of its own, since they will, by definition, not be
request-specific.  If you find you *must* define them, then yes, you should
synchronize access to them, as they could be accessed by many threads
simulataneously.

Hope this helps.

Cheers,
Laird

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to