Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Dev

slotmem improving doall

 

 

Apache dev RSS feed   Index | Next | Previous | View Threaded


jfclere at gmail

Sep 29, 2009, 2:23 AM

Post #1 of 6 (404 views)
Permalink
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


jim at jaguNET

Sep 30, 2009, 9:18 AM

Post #2 of 6 (375 views)
Permalink
Re: slotmem improving doall [In reply to]

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?


jfclere at gmail

Oct 1, 2009, 12:44 AM

Post #3 of 6 (377 views)
Permalink
Re: slotmem improving doall [In reply to]

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


jim at jaguNET

Oct 1, 2009, 7:06 AM

Post #4 of 6 (384 views)
Permalink
Re: slotmem improving doall [In reply to]

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?


jfclere at gmail

Oct 1, 2009, 7:21 AM

Post #5 of 6 (363 views)
Permalink
Re: slotmem improving doall [In reply to]

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


jim at apache

Oct 1, 2009, 12:06 PM

Post #6 of 6 (379 views)
Permalink
Re: slotmem improving doall [In reply to]

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 :)

Apache dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.