On Mon, 2002-12-02 at 01:32, Tavis Rudd wrote: > If you decide to use the 'thread-shareable' approach, you'll probably have to > spend some extra time working around issues that most webware users have > never thought about. However, it could, theoretically, reduce the memory > footprint of your application. In some situations it might also yeild small > performance gains.
In practice, I think you'll see little in the way of speed or memory improvements. Having 10 instances of a servlet sitting around instead of 1 isn't a big memory loss -- or if it is, there are many ways to deal with it without making the servlets threadsafe. In particular, in sleep() you can delete (or set to None) attributes you've set up in awake() or elsewhere. As far as speed, I think there will be even less of an improvement. Essentially you'll be storing the same information in the transaction object instead of the servlet object -- but it should be entirely equivalent speed-wise, in both cases you are accessing an instance variable, with the same speed implications. Perhaps if you don't use instance variables, and the transaction is then just sent as an argument to functions, this might be a bit faster. There are many conveniences to coding with non-threadsafe servlets, and it makes factoring significantly easier. Pooling works well, and is Webware's alternative to threadsafeness (but only for servlets -- everything else still has to be threadsafe or pooled on its own, as with DBPool). Ian ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
