On 6/7/06, Cliff Zhao <[EMAIL PROTECTED]> wrote:
Concurrency should be addressed by design.
So what design do you suggest for concurrent accesses to shared objects? The only designs I know are very heavyweight... You need to manually add synchronization to all accesses. Even with the new java.util.concurrentclasses this is still a heavyweight task.,
Can we let SUN put synchronization on every class because of the exeption in my ASO?
This is not just my exception in my ASO but if you google that topic a little, you'll find out that this is a very common issue with all web frameworks. The only known solution that far is to write a servletrequestfilter.
Also your sequencing will cause other issues, make users feel your site is weird. For example, at one page, the user use the File/New Window in IE to open a window and submit a transaction, the transaction may take a while, the user goes back to the first page to sumbit another transaction. You will block the transaction since the other transaction is running? I will be very unpleased if I were the user.
Yes but in a typical application, I bet that long transaction pages are not the most common. Also I don't know about what length of transactions your are thinking but with our app and a modern server most rendering times are < 100 ms even with complex db queries. And with <100 ms I'm not sure that a user would even notice that. Also the page must be quite long if a user has the time to open File/New Window... And additionally queuing concurrent request will provide a smoother response when your server will have lots of concurrent users. That is why there should be a flexible and configurable mecanism. For most pages you probably want to queue the requests and prevent concurrent accesses but for some you may want to not use the synchronization. Maybe having synchronization on by default is a little extreme but having a flag on each page to synchronize the rendering would be IMO a very valuable feature. Anyway I read James post about aegi integration and I'll try to use the same technique (enhancement workers) to synchronize the page rendering. This would make such feature pluggable. Henri.
