[m-dev.] More trailing bugs. :-)

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Jan 31 14:45:13 AEDT 2000


On 31-Jan-2000, Warwick Harvey <wharvey at cs.monash.edu.au> wrote:
> Fergus wrote:
> > On 28-Jan-2000, Warwick Harvey <wharvey at cs.monash.edu.au> wrote:
> > > My understanding of how the trailing operations should work, is that during 
> > > forward execution, the ticket counter should never decrease.
> > 
> > This is not the case.
> [...]
> 
> OK, you've convinced me there are some problems with this.
> 
> So I have another proposal.  :-)
> 
> The problem I described is not so much that the ticket counter / choicepoint 
> ID is decremented, but rather that values are re-used.  What if we introduce 
> a ticket "high water mark", and redefine MR_store_ticket() as follows:
> 
>         /*
>         ** Called when we create a choice point
>         ** (including semidet choice points).
>         */
> /* void MR_store_ticket(Word &); */
> #define MR_store_ticket(save_trail_ptr)                         \
>         do {                                                    \
>                 (save_trail_ptr) = (Word) MR_trail_ptr;         \
>                 MR_ticket_counter = ++MR_ticket_high_water;     \
>         } while(0)
> 
> That avoids the ID re-use problem, and means we are allowed to decrement the 
> counter, so that redundant trailing isn't crippled.  Can you see any 
> problems with this approach?

Does MR_ticket_high_water ever get reset?
If so, your description above is incomplete.
If not, then long-running programs may run into
problems with MR_ticket_high_water overflowing.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list