You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by jean-frederic clere <jf...@gmail.com> on 2009/09/29 11:23:35 UTC
slotmem improving doall
Hi,
I would like to change the doall / ap_slotmem_callback_fn_t logic.
For the moment we can't stop the doall loop, but it could be interesting
to do so (for example while search for a value in the slotmems).
My idea is to return APR_SUCCESS when done and APR_INCOMPLETE if we want
to go on doing the loop.
Comments?
Cheers
Jean-Frederic
Re: slotmem improving doall
Posted by Jim Jagielski <ji...@apache.org>.
On Oct 1, 2009, at 10:21 AM, jean-frederic clere wrote:
>>
>> I mean if doall returns APR_INCOMPLETE, it means that it stopped at
>> some point within the loop.
>
> Yes
>
>>
>> But how would the caller know where and how would the caller
>> re-start the loop but say "start here instead"?
>
> That would be the problem of the caller. If the callback stops the
> doall loop it should have the logic to skip the slots it already
> processed no?
>
Yeah, but the params to doall() don't provide enough info for that.
>>
>> Or do you mean that doall would always return APR_SUCCESS but
>> the internal loop of doall could terminate somewhere within
>> the loop?
>>
>
> That was my first idea... If we choose to go that way it is easy :-)
>
OK... how about if we have the doall callback return an apr_status_t
and the internal loop in the doalls continue the loop with an
APR_SUCCESS
and immediately stop on anything else (and return that to the orig
callee).
So APR_SUCCESS means I went through each element of the slot,
APR_INCOMPLETE means I stopped somewhere inside there and all
all others (like APR_EGENERAL) mean something that hopefully makes
sense to the callee :)
Re: slotmem improving doall
Posted by jean-frederic clere <jf...@gmail.com>.
On 10/01/2009 04:06 PM, Jim Jagielski wrote:
>
> On Oct 1, 2009, at 3:44 AM, jean-frederic clere wrote:
>
>> On 09/30/2009 06:18 PM, Jim Jagielski wrote:
>>>
>>> On Sep 29, 2009, at 5:23 AM, jean-frederic clere wrote:
>>>
>>>> Hi,
>>>>
>>>> I would like to change the doall / ap_slotmem_callback_fn_t logic.
>>>> For the moment we can't stop the doall loop, but it could be
>>>> interesting to do so (for example while search for a value in the
>>>> slotmems).
>>>> My idea is to return APR_SUCCESS when done and APR_INCOMPLETE if we
>>>> want to go on doing the loop.
>>>>
>>>
>>> How would it be re-entrant?
>>>
>>
>> hmmm... Well the caller would have to solve that problem, it is a loop
>> calling a callback, no?
>>
>
> I mean if doall returns APR_INCOMPLETE, it means that it stopped at
> some point within the loop.
Yes
>
> But how would the caller know where and how would the caller
> re-start the loop but say "start here instead"?
That would be the problem of the caller. If the callback stops the doall
loop it should have the logic to skip the slots it already processed no?
>
> Or do you mean that doall would always return APR_SUCCESS but
> the internal loop of doall could terminate somewhere within
> the loop?
>
That was my first idea... If we choose to go that way it is easy :-)
Cheers
Jean-Frederic
Re: slotmem improving doall
Posted by Jim Jagielski <ji...@jaguNET.com>.
On Oct 1, 2009, at 3:44 AM, jean-frederic clere wrote:
> On 09/30/2009 06:18 PM, Jim Jagielski wrote:
>>
>> On Sep 29, 2009, at 5:23 AM, jean-frederic clere wrote:
>>
>>> Hi,
>>>
>>> I would like to change the doall / ap_slotmem_callback_fn_t logic.
>>> For the moment we can't stop the doall loop, but it could be
>>> interesting to do so (for example while search for a value in the
>>> slotmems).
>>> My idea is to return APR_SUCCESS when done and APR_INCOMPLETE if we
>>> want to go on doing the loop.
>>>
>>
>> How would it be re-entrant?
>>
>
> hmmm... Well the caller would have to solve that problem, it is a
> loop calling a callback, no?
>
I mean if doall returns APR_INCOMPLETE, it means that it stopped at
some point within the loop.
But how would the caller know where and how would the caller
re-start the loop but say "start here instead"?
Or do you mean that doall would always return APR_SUCCESS but
the internal loop of doall could terminate somewhere within
the loop?
Re: slotmem improving doall
Posted by jean-frederic clere <jf...@gmail.com>.
On 09/30/2009 06:18 PM, Jim Jagielski wrote:
>
> On Sep 29, 2009, at 5:23 AM, jean-frederic clere wrote:
>
>> Hi,
>>
>> I would like to change the doall / ap_slotmem_callback_fn_t logic.
>> For the moment we can't stop the doall loop, but it could be
>> interesting to do so (for example while search for a value in the
>> slotmems).
>> My idea is to return APR_SUCCESS when done and APR_INCOMPLETE if we
>> want to go on doing the loop.
>>
>
> How would it be re-entrant?
>
hmmm... Well the caller would have to solve that problem, it is a loop
calling a callback, no?
Cheers
Jean-Frederic
Re: slotmem improving doall
Posted by Jim Jagielski <ji...@jaguNET.com>.
On Sep 29, 2009, at 5:23 AM, jean-frederic clere wrote:
> Hi,
>
> I would like to change the doall / ap_slotmem_callback_fn_t logic.
> For the moment we can't stop the doall loop, but it could be
> interesting to do so (for example while search for a value in the
> slotmems).
> My idea is to return APR_SUCCESS when done and APR_INCOMPLETE if we
> want to go on doing the loop.
>
How would it be re-entrant?