Re: servlet+thread+jni
- From: "SPG" <steve.goodsell@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 11 Apr 2005 23:08:37 GMT
"stef" <spe@xxxxxxxxxx> wrote in message
news:425afe99$0$28600$636a15ce@xxxxxxxxxxxxxxx
> Hi again :)
>
> Thx for the anwser
>
>>
>> A) Make your servlets single threaded by default (using the config of
>> your
>> web app), but his could cause you some
>
> SPG, what you say, is very interesting...
>
> What kind of action/consequence have the fact to switch servlet to single
> thread ?
> Does it mean java will use fork() instead (I go crazy :))
>
> Seriously. How java does to manager multi-connexion in this case ?
> May be playing with synchronize() palette functions
>
> Could U tell me more please ?
>
>
> thanx :)
>
>
>
>
>
>
Stef,
If you make your servlets signle threaded, then you will (and I think I need
to consult docs to be 100% on this) create a new instance of your servlet on
each connection, hence put some extra load on the servers and could cause
you some performance. This also means one connection at a time hence all
other connections are queued... Again, causing some unwanted delays to your
users..
Another problem with making your servlet single threaded is that it only
makes the specific servlet single threaded. Shared resources will still be
vulnerable.
My suggestion is that you identify your potential critical sections of code
(IE: Where you need to make calls out via JNI ) and synchronize specifically
around these. Be careful not to over synchronize else you will hit more
performance issues.
Have a look through the java.sun.com forums and see examples there..
Steve
.
- References:
- servlet+thread+jni
- From: stef
- Re: servlet+thread+jni
- From: SPG
- Re: servlet+thread+jni
- From: stef
- servlet+thread+jni
- Prev by Date: Re: servlet+thread+jni
- Next by Date: Re: servlet+thread+jni
- Previous by thread: Re: servlet+thread+jni
- Next by thread: Re: servlet+thread+jni
- Index(es):
Relevant Pages
|