Threaded Servlet

2009-01-23 Thread stephen.sm...@paretopartners.com
Standard servlets create a new thread per request but from a few simple test i have run this appears not to be the case with GWT. Why is this and is there any way to do this other than explicitly creating a new thread at each method my service exposes. Thanks in advance, Stephen --~--~-~

Re: Threaded Servlet

2009-01-23 Thread Shawn Pearce
On Fri, Jan 23, 2009 at 08:17, stephen.sm...@paretopartners.com < stephen.sm...@paretopartners.com> wrote: > > Standard servlets create a new thread per request but from a few > simple test i have run this appears not to be the case with GWT. > *Wrong*. Standard servlets create *one* instance pe

Re: Threaded Servlet

2009-01-27 Thread stephen.sm...@paretopartners.com
I never said it cretaed multiple instances, simply a new thread per request. On Jan 23, 4:30 pm, Shawn Pearce wrote: > On Fri, Jan 23, 2009 at 08:17, stephen.sm...@paretopartners.com < > > stephen.sm...@paretopartners.com> wrote: > > > Standard servlets create a new thread per request but from a

Re: Threaded Servlet

2009-01-27 Thread Jason Morris
Actually most containers pool their processor threads in order to conserve and regulate resources. The RemoteServiceServlet in GWT simply decodes the response and invokes the method which the request relates to. Theres no magic or rocket science going on here. I don't know what tests you've r

Re: Threaded Servlet

2009-01-27 Thread Lothar Kimmeringer
stephen.sm...@paretopartners.com schrieb: > On Jan 23, 4:30 pm, Shawn Pearce wrote: >> On Fri, Jan 23, 2009 at 08:17, stephen.sm...@paretopartners.com < >> >> stephen.sm...@paretopartners.com> wrote: >> >>> Standard servlets create a new thread per request but from a few >>> simple test i have ru

Re: Threaded Servlet

2009-01-27 Thread Shawn Pearce
On Tue, Jan 27, 2009 at 01:42, stephen.sm...@paretopartners.com < stephen.sm...@paretopartners.com> wrote: > > I never said it cretaed multiple instances, simply a new thread per > request. > *sigh*. I must not have had enough coffee in the morning before replying to your post. I read "thread"

Re: Threaded Servlet

2009-01-27 Thread stephen.sm...@paretopartners.com
@shawn Thats ok :) @jason Well these "Tests" are very basic. i create an app with a simple rpc call to the server that does something like this: public boolean serverMethod() { for (;;) { if (false) { break; } } return true; } public boolean anotherMethod() { return true;

Re: Threaded Servlet

2009-01-27 Thread Jason Morris
I tried reproducing your test to see what you were getting. I found the behavior when I ran the code in Hosted Mode and executed "serverMethod()" /twice/ before executing "anotherMethod()" (it didn't matter how many Hosted Browsers I had open). When running the same test in real browsers (I u

Re: Threaded Servlet

2009-01-28 Thread stephen.sm...@paretopartners.com
My appologies jason, you were correct. I totally forgot about max connections per browser. So it would appear that my servlet is multi theaded after all and as a result, not thread safe :) Maybe this should be added to the GWT docs as this is something that i feel could be very easily overlooked

Re: Threaded Servlet

2009-01-28 Thread Ben Tilford
>From the documentation Servlets typically run on multithreaded servers, so be aware that a servlet must handle concurrent requests and be careful to synchronize access to shared resources. Shared resources include in-memory data such as instance or class variables and external objects such as fil

Re: Threaded Servlet

2009-01-29 Thread stephen.sm...@paretopartners.com
Cant find that anywhere. Can you post a link please On Jan 28, 2:06 pm, Ben Tilford wrote: > From the documentation > > Servlets typically run on multithreaded servers, so be aware that a servlet > must handle concurrent requests and be careful to synchronize access to > shared resources. Shared

Re: Threaded Servlet

2009-01-29 Thread Ben Tilford
Google didn't write the servlet spec, all servlet containers follow the spec sun wrote. http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/http/HttpServlet.html On Thu, Jan 29, 2009 at 5:25 AM, stephen.sm...@paretopartners.com < stephen.sm...@paretopartners.com> wrote: > > Cant find