You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by mt...@apache.org on 2010/08/24 15:33:18 UTC
svn commit: r988537 - in /tomcat/native/trunk/native: build/tcnative.m4
src/jnilib.c
Author: mturk
Date: Tue Aug 24 13:33:18 2010
New Revision: 988537
URL: http://svn.apache.org/viewvc?rev=988537&view=rev
Log:
Allow using vedor APR that have lower then required version but required API
Modified:
tomcat/native/trunk/native/build/tcnative.m4
tomcat/native/trunk/native/src/jnilib.c
Modified: tomcat/native/trunk/native/build/tcnative.m4
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/build/tcnative.m4?rev=988537&r1=988536&r2=988537&view=diff
==============================================================================
--- tomcat/native/trunk/native/build/tcnative.m4 (original)
+++ tomcat/native/trunk/native/build/tcnative.m4 Tue Aug 24 13:33:18 2010
@@ -33,8 +33,11 @@ AC_DEFUN(TCN_FIND_APR,[
sapr_version="`echo $sapr_pversion|sed -e 's/\([a-z]*\)$/.\1/'`"
tc_save_IFS=$IFS; IFS=.; set $sapr_version; IFS=$tc_save_IFS
decimal_apr_version=`printf %02d%02d%03d ${1} ${2} ${3}`
- if test "${decimal_apr_version}" -lt "0104002"; then
- AC_MSG_ERROR(Found APR $sapr_version. You need version 1.4.2 or newer installed.)
+ if test "${decimal_apr_version}" -lt "0102000"; then
+ AC_MSG_ERROR(Found APR $sapr_version. You need version 1.2 or newer installed.)
+ fi
+ if test "${decimal_apr_version}" -lt "0104000"; then
+ AC_MSG_NOTICE(APR $sapr_version detected.)
fi
APR_BUILD_DIR="`$apr_config --installbuilddir`"
Modified: tomcat/native/trunk/native/src/jnilib.c
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/jnilib.c?rev=988537&r1=988536&r2=988537&view=diff
==============================================================================
--- tomcat/native/trunk/native/src/jnilib.c (original)
+++ tomcat/native/trunk/native/src/jnilib.c Tue Aug 24 13:33:18 2010
@@ -65,9 +65,16 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM
apr_version(&apv);
apvn = apv.major * 1000 + apv.minor * 100 + apv.patch;
if (apvn < 1400) {
+#if defined(HAVE_POOL_PRE_CLEANUP) && defined(HAVE_POLLSET_WAKEUP)
+ /* Althugh not 1.4.x, APR has required functionality.
+ * Note that this is compile time definition, and we
+ * presume the required API's are present in the custom APR.
+ */
+#else
tcn_Throw(env, "Unupported APR version (%s)",
apr_version_string());
return JNI_ERR;
+#endif
}
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: svn commit: r988537 - in /tomcat/native/trunk/native: build/tcnative.m4
src/jnilib.c
Posted by jean-frederic clere <jf...@gmail.com>.
On 08/24/2010 04:07 PM, jean-frederic clere wrote:
> On 08/24/2010 03:33 PM, mturk@apache.org wrote:
>> Author: mturk
>> Date: Tue Aug 24 13:33:18 2010
>> New Revision: 988537
>>
>> URL: http://svn.apache.org/viewvc?rev=988537&view=rev
>> Log:
>> Allow using vedor APR that have lower then required version but required API
>>
>> Modified:
>> tomcat/native/trunk/native/build/tcnative.m4
>> tomcat/native/trunk/native/src/jnilib.c
>>
>> Modified: tomcat/native/trunk/native/build/tcnative.m4
>> URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/build/tcnative.m4?rev=988537&r1=988536&r2=988537&view=diff
>> ==============================================================================
>> --- tomcat/native/trunk/native/build/tcnative.m4 (original)
>> +++ tomcat/native/trunk/native/build/tcnative.m4 Tue Aug 24 13:33:18 2010
>> @@ -33,8 +33,11 @@ AC_DEFUN(TCN_FIND_APR,[
>> sapr_version="`echo $sapr_pversion|sed -e 's/\([a-z]*\)$/.\1/'`"
>> tc_save_IFS=$IFS; IFS=.; set $sapr_version; IFS=$tc_save_IFS
>> decimal_apr_version=`printf %02d%02d%03d ${1} ${2} ${3}`
>> - if test "${decimal_apr_version}" -lt "0104002"; then
>> - AC_MSG_ERROR(Found APR $sapr_version. You need version 1.4.2 or newer installed.)
>> + if test "${decimal_apr_version}" -lt "0102000"; then
>> + AC_MSG_ERROR(Found APR $sapr_version. You need version 1.2 or newer installed.)
>> + fi
>> + if test "${decimal_apr_version}" -lt "0104000"; then
>> + AC_MSG_NOTICE(APR $sapr_version detected.)
>> fi
>>
>> APR_BUILD_DIR="`$apr_config --installbuilddir`"
>>
>> Modified: tomcat/native/trunk/native/src/jnilib.c
>> URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/jnilib.c?rev=988537&r1=988536&r2=988537&view=diff
>> ==============================================================================
>> --- tomcat/native/trunk/native/src/jnilib.c (original)
>> +++ tomcat/native/trunk/native/src/jnilib.c Tue Aug 24 13:33:18 2010
>> @@ -65,9 +65,16 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM
>> apr_version(&apv);
>> apvn = apv.major * 1000 + apv.minor * 100 + apv.patch;
>> if (apvn < 1400) {
>> +#if defined(HAVE_POOL_PRE_CLEANUP) && defined(HAVE_POLLSET_WAKEUP)
>
> But apr_pollset_wakeup() is not used even in trunk, so why?
> Why not only HAVE_POLLSET_WAKEUP?
Oops I meant: Why not only:
#if defined(HAVE_POOL_PRE_CLEANUP)
Cheers
Jean-Frederic
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: svn commit: r988537 - in /tomcat/native/trunk/native: build/tcnative.m4
src/jnilib.c
Posted by Mladen Turk <mt...@apache.org>.
On 08/24/2010 04:56 PM, jean-frederic clere wrote:
> On 08/24/2010 04:30 PM, Mladen Turk wrote:
>> On 08/24/2010 04:07 PM, jean-frederic clere wrote:
>>> On 08/24/2010 03:33 PM, mturk@apache.org wrote:
>>>> Author: mturk
>>>> Date: Tue Aug 24 13:33:18 2010
>>>> New Revision: 988537
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=988537&view=rev
>>>> Log:
>>>> Allow using vedor APR that have lower then required version but
>>>> required API
>>>>
>>>> Modified:
>>>> tomcat/native/trunk/native/build/tcnative.m4
>>>> tomcat/native/trunk/native/src/jnilib.c
>>>>
>>>> Modified: tomcat/native/trunk/native/build/tcnative.m4
>>>> URL:
>>>> http://svn.apache.org/viewvc/tomcat/native/trunk/native/build/tcnative.m4?rev=988537&r1=988536&r2=988537&view=diff
>>>>
>>>> ==============================================================================
>>>>
>>>> --- tomcat/native/trunk/native/build/tcnative.m4 (original)
>>>> +++ tomcat/native/trunk/native/build/tcnative.m4 Tue Aug 24 13:33:18
>>>> 2010
>>>> @@ -33,8 +33,11 @@ AC_DEFUN(TCN_FIND_APR,[
>>>> sapr_version="`echo $sapr_pversion|sed -e 's/\([a-z]*\)$/.\1/'`"
>>>> tc_save_IFS=$IFS; IFS=.; set $sapr_version; IFS=$tc_save_IFS
>>>> decimal_apr_version=`printf %02d%02d%03d ${1} ${2} ${3}`
>>>> - if test "${decimal_apr_version}" -lt "0104002"; then
>>>> - AC_MSG_ERROR(Found APR $sapr_version. You need version 1.4.2 or
>>>> newer installed.)
>>>> + if test "${decimal_apr_version}" -lt "0102000"; then
>>>> + AC_MSG_ERROR(Found APR $sapr_version. You need version 1.2 or
>>>> newer installed.)
>>>> + fi
>>>> + if test "${decimal_apr_version}" -lt "0104000"; then
>>>> + AC_MSG_NOTICE(APR $sapr_version detected.)
>>>> fi
>>>>
>>>> APR_BUILD_DIR="`$apr_config --installbuilddir`"
>>>>
>>>> Modified: tomcat/native/trunk/native/src/jnilib.c
>>>> URL:
>>>> http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/jnilib.c?rev=988537&r1=988536&r2=988537&view=diff
>>>>
>>>> ==============================================================================
>>>>
>>>> --- tomcat/native/trunk/native/src/jnilib.c (original)
>>>> +++ tomcat/native/trunk/native/src/jnilib.c Tue Aug 24 13:33:18 2010
>>>> @@ -65,9 +65,16 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM
>>>> apr_version(&apv);
>>>> apvn = apv.major * 1000 + apv.minor * 100 + apv.patch;
>>>> if (apvn< 1400) {
>>>> +#if defined(HAVE_POOL_PRE_CLEANUP)&& defined(HAVE_POLLSET_WAKEUP)
>>>
>>> But apr_pollset_wakeup() is not used even in trunk, so why?
>>
>> Work in progress ...
>> Will be used in new Poll.interrupt API so we can remove all
>> that clumsy pollTime/maintainTime logic for adding new sockets
>> to the pollset.
>> It should lower the accept latency, remove the need for
>> socket add queue and remove unnecessary thread context switches.
>
> Well the accept is done in a different thread anyway. Additionally with
> defer accept we won't see any changes accept latency.
>
Right, I didn't mean accept since we never put freshly
accepted sockets in the poll anyhow.
I meant adding accepted sockets for the first time after
the request was handled and marked for keepalive.
Currently we do a probe read cause the pollTime latency is
too high for directly using the pollset.
Also once when added to the queue the pollTime determines the
new request latency cause during the time when we add the
socket to the pollset we are presuming no new data will
arrive during the pollTime.
Whether this operation
socket->nonblock, read, socket->block, add to poll queue
is slower or faster then a apr_pollset_wakeup call is
IMO worth experimenting.
If it proves to have none or very low impact we just won't
use it.
Regards
--
^TM
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: svn commit: r988537 - in /tomcat/native/trunk/native:
build/tcnative.m4 src/jnilib.c
Posted by Remy Maucherat <re...@apache.org>.
On Tue, 2010-08-24 at 16:56 +0200, jean-frederic clere wrote:
> Well the accept is done in a different thread anyway. Additionally with
> defer accept we won't see any changes accept latency.
Indeed, no change. But Windows is different enough that it would need
significantly different code to be completely optimal. But I don't care
at all about Windows as long as things remains good enough (as I think
it is right now), since without defer accept it will always be inferior
anyway.
Rémy
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: svn commit: r988537 - in /tomcat/native/trunk/native: build/tcnative.m4
src/jnilib.c
Posted by jean-frederic clere <jf...@gmail.com>.
On 08/24/2010 04:30 PM, Mladen Turk wrote:
> On 08/24/2010 04:07 PM, jean-frederic clere wrote:
>> On 08/24/2010 03:33 PM, mturk@apache.org wrote:
>>> Author: mturk
>>> Date: Tue Aug 24 13:33:18 2010
>>> New Revision: 988537
>>>
>>> URL: http://svn.apache.org/viewvc?rev=988537&view=rev
>>> Log:
>>> Allow using vedor APR that have lower then required version but
>>> required API
>>>
>>> Modified:
>>> tomcat/native/trunk/native/build/tcnative.m4
>>> tomcat/native/trunk/native/src/jnilib.c
>>>
>>> Modified: tomcat/native/trunk/native/build/tcnative.m4
>>> URL:
>>> http://svn.apache.org/viewvc/tomcat/native/trunk/native/build/tcnative.m4?rev=988537&r1=988536&r2=988537&view=diff
>>>
>>> ==============================================================================
>>>
>>> --- tomcat/native/trunk/native/build/tcnative.m4 (original)
>>> +++ tomcat/native/trunk/native/build/tcnative.m4 Tue Aug 24 13:33:18
>>> 2010
>>> @@ -33,8 +33,11 @@ AC_DEFUN(TCN_FIND_APR,[
>>> sapr_version="`echo $sapr_pversion|sed -e 's/\([a-z]*\)$/.\1/'`"
>>> tc_save_IFS=$IFS; IFS=.; set $sapr_version; IFS=$tc_save_IFS
>>> decimal_apr_version=`printf %02d%02d%03d ${1} ${2} ${3}`
>>> - if test "${decimal_apr_version}" -lt "0104002"; then
>>> - AC_MSG_ERROR(Found APR $sapr_version. You need version 1.4.2 or
>>> newer installed.)
>>> + if test "${decimal_apr_version}" -lt "0102000"; then
>>> + AC_MSG_ERROR(Found APR $sapr_version. You need version 1.2 or
>>> newer installed.)
>>> + fi
>>> + if test "${decimal_apr_version}" -lt "0104000"; then
>>> + AC_MSG_NOTICE(APR $sapr_version detected.)
>>> fi
>>>
>>> APR_BUILD_DIR="`$apr_config --installbuilddir`"
>>>
>>> Modified: tomcat/native/trunk/native/src/jnilib.c
>>> URL:
>>> http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/jnilib.c?rev=988537&r1=988536&r2=988537&view=diff
>>>
>>> ==============================================================================
>>>
>>> --- tomcat/native/trunk/native/src/jnilib.c (original)
>>> +++ tomcat/native/trunk/native/src/jnilib.c Tue Aug 24 13:33:18 2010
>>> @@ -65,9 +65,16 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM
>>> apr_version(&apv);
>>> apvn = apv.major * 1000 + apv.minor * 100 + apv.patch;
>>> if (apvn< 1400) {
>>> +#if defined(HAVE_POOL_PRE_CLEANUP)&& defined(HAVE_POLLSET_WAKEUP)
>>
>> But apr_pollset_wakeup() is not used even in trunk, so why?
>
> Work in progress ...
> Will be used in new Poll.interrupt API so we can remove all
> that clumsy pollTime/maintainTime logic for adding new sockets
> to the pollset.
> It should lower the accept latency, remove the need for
> socket add queue and remove unnecessary thread context switches.
Well the accept is done in a different thread anyway. Additionally with
defer accept we won't see any changes accept latency.
Cheers
Jean-Frederic
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: svn commit: r988537 - in /tomcat/native/trunk/native:
build/tcnative.m4 src/jnilib.c
Posted by Remy Maucherat <re...@apache.org>.
On Tue, 2010-08-24 at 16:30 +0200, Mladen Turk wrote:
> Work in progress ...
> Will be used in new Poll.interrupt API so we can remove all
> that clumsy pollTime/maintainTime logic for adding new sockets
> to the pollset.
> It should lower the accept latency, remove the need for
> socket add queue and remove unnecessary thread context switches.
What is the usefulness of constantly interrupting polling ? Surely this
will have a cost too. Right now, while polling is in progress, sockets
are queued, and will be added all at once, which presumably will limit
the amount of thread interactions that would require syncing (and only
adding to the queue is synced, which could actually be optimized away by
using some sort of concurrent structure, but unfortunately this is not
so easy to write). Also, maintain does timeouts, which are not done by
polling, I don't see how this can be dropped.
So I don't understand how this can perform better, but feel free to
experiment ;) Maybe on Windows it would yield something (without any
accept filter/defer/whatever, it will suffer from the ms-scale latency,
which is normally not a real world issue, but if it wasn't there it
would be nicer), at the expense of the decent platforms.
Rémy
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: svn commit: r988537 - in /tomcat/native/trunk/native: build/tcnative.m4
src/jnilib.c
Posted by Mladen Turk <mt...@apache.org>.
On 08/24/2010 04:07 PM, jean-frederic clere wrote:
> On 08/24/2010 03:33 PM, mturk@apache.org wrote:
>> Author: mturk
>> Date: Tue Aug 24 13:33:18 2010
>> New Revision: 988537
>>
>> URL: http://svn.apache.org/viewvc?rev=988537&view=rev
>> Log:
>> Allow using vedor APR that have lower then required version but required API
>>
>> Modified:
>> tomcat/native/trunk/native/build/tcnative.m4
>> tomcat/native/trunk/native/src/jnilib.c
>>
>> Modified: tomcat/native/trunk/native/build/tcnative.m4
>> URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/build/tcnative.m4?rev=988537&r1=988536&r2=988537&view=diff
>> ==============================================================================
>> --- tomcat/native/trunk/native/build/tcnative.m4 (original)
>> +++ tomcat/native/trunk/native/build/tcnative.m4 Tue Aug 24 13:33:18 2010
>> @@ -33,8 +33,11 @@ AC_DEFUN(TCN_FIND_APR,[
>> sapr_version="`echo $sapr_pversion|sed -e 's/\([a-z]*\)$/.\1/'`"
>> tc_save_IFS=$IFS; IFS=.; set $sapr_version; IFS=$tc_save_IFS
>> decimal_apr_version=`printf %02d%02d%03d ${1} ${2} ${3}`
>> - if test "${decimal_apr_version}" -lt "0104002"; then
>> - AC_MSG_ERROR(Found APR $sapr_version. You need version 1.4.2 or newer installed.)
>> + if test "${decimal_apr_version}" -lt "0102000"; then
>> + AC_MSG_ERROR(Found APR $sapr_version. You need version 1.2 or newer installed.)
>> + fi
>> + if test "${decimal_apr_version}" -lt "0104000"; then
>> + AC_MSG_NOTICE(APR $sapr_version detected.)
>> fi
>>
>> APR_BUILD_DIR="`$apr_config --installbuilddir`"
>>
>> Modified: tomcat/native/trunk/native/src/jnilib.c
>> URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/jnilib.c?rev=988537&r1=988536&r2=988537&view=diff
>> ==============================================================================
>> --- tomcat/native/trunk/native/src/jnilib.c (original)
>> +++ tomcat/native/trunk/native/src/jnilib.c Tue Aug 24 13:33:18 2010
>> @@ -65,9 +65,16 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM
>> apr_version(&apv);
>> apvn = apv.major * 1000 + apv.minor * 100 + apv.patch;
>> if (apvn< 1400) {
>> +#if defined(HAVE_POOL_PRE_CLEANUP)&& defined(HAVE_POLLSET_WAKEUP)
>
> But apr_pollset_wakeup() is not used even in trunk, so why?
Work in progress ...
Will be used in new Poll.interrupt API so we can remove all
that clumsy pollTime/maintainTime logic for adding new sockets
to the pollset.
It should lower the accept latency, remove the need for
socket add queue and remove unnecessary thread context switches.
> Why not only HAVE_POLLSET_WAKEUP?
>
1.1.x branch will only check for HAVE_POOL_PRE_CLEANUP
while trunk will have WAKEUP check as well.
This is only for edge case where APR detected is lover
then required, while the vendor might still backport
the required functionality.
Regards
--
^TM
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: svn commit: r988537 - in /tomcat/native/trunk/native: build/tcnative.m4
src/jnilib.c
Posted by jean-frederic clere <jf...@gmail.com>.
On 08/24/2010 03:33 PM, mturk@apache.org wrote:
> Author: mturk
> Date: Tue Aug 24 13:33:18 2010
> New Revision: 988537
>
> URL: http://svn.apache.org/viewvc?rev=988537&view=rev
> Log:
> Allow using vedor APR that have lower then required version but required API
>
> Modified:
> tomcat/native/trunk/native/build/tcnative.m4
> tomcat/native/trunk/native/src/jnilib.c
>
> Modified: tomcat/native/trunk/native/build/tcnative.m4
> URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/build/tcnative.m4?rev=988537&r1=988536&r2=988537&view=diff
> ==============================================================================
> --- tomcat/native/trunk/native/build/tcnative.m4 (original)
> +++ tomcat/native/trunk/native/build/tcnative.m4 Tue Aug 24 13:33:18 2010
> @@ -33,8 +33,11 @@ AC_DEFUN(TCN_FIND_APR,[
> sapr_version="`echo $sapr_pversion|sed -e 's/\([a-z]*\)$/.\1/'`"
> tc_save_IFS=$IFS; IFS=.; set $sapr_version; IFS=$tc_save_IFS
> decimal_apr_version=`printf %02d%02d%03d ${1} ${2} ${3}`
> - if test "${decimal_apr_version}" -lt "0104002"; then
> - AC_MSG_ERROR(Found APR $sapr_version. You need version 1.4.2 or newer installed.)
> + if test "${decimal_apr_version}" -lt "0102000"; then
> + AC_MSG_ERROR(Found APR $sapr_version. You need version 1.2 or newer installed.)
> + fi
> + if test "${decimal_apr_version}" -lt "0104000"; then
> + AC_MSG_NOTICE(APR $sapr_version detected.)
> fi
>
> APR_BUILD_DIR="`$apr_config --installbuilddir`"
>
> Modified: tomcat/native/trunk/native/src/jnilib.c
> URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/jnilib.c?rev=988537&r1=988536&r2=988537&view=diff
> ==============================================================================
> --- tomcat/native/trunk/native/src/jnilib.c (original)
> +++ tomcat/native/trunk/native/src/jnilib.c Tue Aug 24 13:33:18 2010
> @@ -65,9 +65,16 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM
> apr_version(&apv);
> apvn = apv.major * 1000 + apv.minor * 100 + apv.patch;
> if (apvn < 1400) {
> +#if defined(HAVE_POOL_PRE_CLEANUP) && defined(HAVE_POLLSET_WAKEUP)
But apr_pollset_wakeup() is not used even in trunk, so why?
Why not only HAVE_POLLSET_WAKEUP?
Cheers
Jean-Frederic
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org