Frank Morton wrote:
>
> Can someone straighten me out. I thought that with each
> instance of a connection to an "HttpServlet" lived in
> a separate thread. When I access the same servlet,
> if the first one is doing a long query, the other one
> is stuck waiting until the first is done. What do I have
> to do avoid this problem? I'd appreciate some guidance. I
> must be missing something simple as this has to be
> a very common issue.
>
I believe this is an issue with the thread mechanism on your
operating system. For example on linux running green threads
on a single CPU the running thread will NOT yield to another
thread of equal priority until it blocks (at least thats the way
on my setup), i.e. threads don't preempt. So if you have
a long running non-blocking thread it will not yield to
your new thread. If you know its going to take a long time
and isn't going to block then lower its priority or explicitely program
in some yield statements. Or run a multi-processor or find a better
thread implementation.
Note: you can prove this to yourself by writting a little
thread test program.
Regards
Geoff
--
Geoff Smith
SoftSmiths Pty. Ltd.
Server Side Solutions
ACN 056 452 683
54 Wylma St., Holland Pk., Q, 4121, Australia
Phone: +61 (0)7 38472990
Fax: +61 (0)7 38472707
Mobile:+61 (0)4 12007354
Email: [EMAIL PROTECTED]
WWW: http://www.softsmiths.com.au
----------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://www.working-dogs.com/>
Problems?: [EMAIL PROTECTED]