Shortest reasonable delay?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Shortest reasonable delay?

Schwab,Wilhelm K
Hello all,

I am doing some things that got me thinking about timeouts shorter than
1 second, and have made some small modifications to my TimedEvaluators
package to allow it.  This seems to make sense only for headless
situations; there isn't much point to opening a progress dialog for 10
milliseconds.

With that in mind, I changed the timeout to be stored in milliseconds,
added accessors for same and rewrote #timeoutSeconds[:] in terms of
them.  Most of the code is unchanged; the headless class looks at
whether it has a short wait (less than one second), in which case it
simply does one wait vs. stepping by seconds.  Otherwise, it works as
before.

And finally my long-awaited question: do you have any thoughts on what
would be the smallest reasonable timeout?  Or, is one millisecond
getting to be a very long time for Dolphin Processes?  I am thinking of
adding an assertion to validate the timeout.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Shortest reasonable delay?

Blair McGlashan
"Bill Schwab" <[hidden email]> wrote in message
news:c9nm2d$15fk$[hidden email]...

> Hello all,
>
> I am doing some things that got me thinking about timeouts shorter than
> 1 second, and have made some small modifications to my TimedEvaluators
> package to allow it.  This seems to make sense only for headless
> situations; there isn't much point to opening a progress dialog for 10
> milliseconds.
>
> With that in mind, I changed the timeout to be stored in milliseconds,
> added accessors for same and rewrote #timeoutSeconds[:] in terms of
> them.  Most of the code is unchanged; the headless class looks at
> whether it has a short wait (less than one second), in which case it
> simply does one wait vs. stepping by seconds.  Otherwise, it works as
> before.
>
> And finally my long-awaited question: do you have any thoughts on what
> would be the smallest reasonable timeout?  Or, is one millisecond
> getting to be a very long time for Dolphin Processes?  I am thinking of
> adding an assertion to validate the timeout.
>

It depends on the speed of the machine, how loaded it is, and is really
quite unpredictable. The millisecond clock resolution on some machines is
10mS. I think you will find that any test of the timeout would either have
to allow a great deal of error (in which case, is it a useful test?), or be
based on some average over a large number of periods.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Shortest reasonable delay?

Schwab,Wilhelm K
Blair,

> It depends on the speed of the machine, how loaded it is, and is really
> quite unpredictable. The millisecond clock resolution on some machines is
> 10mS. I think you will find that any test of the timeout would either have
> to allow a great deal of error (in which case, is it a useful test?), or be
> based on some average over a large number of periods.

The tests are definitely useful when the timeout is "large".  I am
mostly interested in seeing that it does the correct thing when it
should succeed, and when it must time out (because it waits on a
semaphore that is never signalled).

Most likely, I will not bother with an assertion, and if things are
unpredicatable for small timeouts, that should be fine.  I doubt that I
would use anything below 500 msec anyway.

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]