[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Confidence indicators for procedures.

From: Ben Pfaff
Subject: Re: Confidence indicators for procedures.
Date: Mon, 02 Jul 2007 08:24:07 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.99 (gnu/linux)

John Darrington <address@hidden> writes:

> Executing procedures involving very large data sets obviously takes a
> finite time.  If people are going to have confidence in the GUI, they
> need to have some sort of indication that the procedure is running,
> and an idea of how far it is away from completion.

It is going to be pretty easy to produce an indication that a
procedure is running, I think.  

> It is possible to add some sort of callback in procedure.c and/or
> casreader-*.c ?  (There are a number of while loops --- I'm not sure
> which will need attention)  

It depends on what you want to measure.  If you want to measure
how much of the active file has been read, then you could put a
callback at the beginning of proc_casereader_read, outside the
loop.  Then you'll get a call every time a case is read from the
active file.  (If the procedure makes multiple passes you'll only
get a call the first time a given case is read.)

How far a procedure is from completion is more difficult, of
course, because there's no way to tell how much processing is
going to happen, how many passes the procedure will make, etc.

> The trick is, not to allow the confidence indicators themselves
> to significantly increase execution time.  So instead of
> reporting at each iteration, it would be best to report at
> pre-determined intervals of real time.

One possibility:

signal(SIGALRM, sigalrm_handler);
setitimer(ITIMER_REAL, ...);

   alarm_triggered = 1;

In the callback:
   if (alarm_triggered) {
     alarm_triggered = 0;
     ...update indicator...

There's a race between test and reset in the callback but we
really don't care in this case.
"The sound of peacocks being shredded can't possibly be
 any worse than the sound of peacocks not being shredded."
Tanuki the Raccoon-dog in the Monastery

reply via email to

[Prev in Thread] Current Thread [Next in Thread]