Tavis Rudd writes: > On Thursday 06 December 2001 10:35, Daniel Popowich wrote: > > What happens then on a heavily loaded system when 100s or more are > > hitting the same Servlet? Could this not lead to disaster if in my > > code I always refer to self.request() to get the request object? > > Couldn't one request overwrite another? > > canBeReused() is only part of the story. There's another method > called canBeThreaded() that returns False by default. Unless this is > set to True, each thread will use a separate instance of the servlet. > If you have 10 threads you will have a pool of 10 servlet instances. > Thus, there is no problem with concurrency.
And may I assume that if I have more requests than threads, they excessive requests will block? > > 3. Use instance attributes for data meaningful across all > > sessions and requests. > > No, use something else for this. You should use a database, a ZODB > store, or something else with the appropriate synchronization > mechanisms to avoid conflicts between threads. Store a reference to > your shared object in a python module that can be imported from > anywhere, or as an attibute of the Application. I'm thinking about data like that found in the Colors example that comes with WebWare. It's painful to compute everytime and since the data will not change across all users/sessions/requests, caching it in the instance is fine. Daniel Popowich Wordbox, Inc. _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
