On Wed, Dec 20, 2023 at 08:03:02AM +0800, Qian Yun wrote:
> 
> 
> On 12/20/23 00:59, Waldek Hebisch wrote:
> > On Tue, Dec 19, 2023 at 08:46:41PM +0800, Qian Yun wrote:
> > > 
> > > If you want to use "push", then what happens to not catched errors,
> > > for example "1/0"?
> > 
> > Well, eventually something should catch error.  And the place catching
> > it should do the unwinding loop.  We need to look what is simpler:
> > unwinding loop at all relevant catchers (many only catches where
> > timing context changes are relevant) or putting 'stopTimedName'
> > inside UNWIND-PROTECT cleanup.
> 
> Currently we are collecting stats on a line-by-line basis,
> "processInteractive" can be considered as "toplevel" for
> line-by-line execution.
> 
> So it is natural to reset '$timedNameStack' here.
> 
> > > Then '$timedNameStack' will keep growing.
> > 
> > Well, if cleanup is done correctly than no.
> > 
> > > So I think use assignment to initialize this dynamic variable
> > > is the correct approach.
> > 
> > Assignment has trouble with accounting
> > 
> 
> You mean current problem with nested stats collection?
> If using each '$timedNameStack is in its own dynamic scope,
> then there will be no problem.

There is a problem: we need to run 'stopTimingProcess' with
correct argument, othewise we will charge resources to
wrong group.  And once '$timedNameStack' is poped we lost
info about group.  So we need to run 'stopTimingProcess'
before restoring previous value of '$timedNameStack'.
Current loop works here.  Calling '$timedNameStack' in
UNWID-PROTECT cleanup could work too.  Just restoring
'$timedNameStack' as dynamic variable will miss
calls to 'stopTimingProcess' leading to wrong accounting.

-- 
                              Waldek Hebisch

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/fricas-devel/ZYJKKAiXrYAAQnwh%40fricas.org.

Reply via email to