[Lazarus] sleep function don't passed before executing the next statement

Mark Morgan Lloyd markMLl.lazarus at telemetry.co.uk
Wed Nov 21 12:38:33 CET 2012


Hans-Peter Diettrich wrote:
> Mark Morgan Lloyd schrieb:
>> Michael Schnell wrote:
> 
>>> (Same is true for any "busy wait" polling loops in the main thread 
>>> and "busy wait" polling loops without sleep in worker threads.)
>>
>> Also much database stuff in my experience. *Anything* which doesn't 
>> return immediately is very bad news from a usability POV.
> 
> IMO there is no strict borderline between possibly lengthy operations, 
> from loading an file into memory up to loading a complex database query 
> result. When the user cannot proceed unless the operation has finished, 
> the GUI can wait that time, too.

I agree. But when loading a (local) file a program can estimate how long 
it's going to take based on its size, while there is no way to estimate 
how long a query will take to run and transfer a resultset since even a 
simple count() depends on the number of matching rows rather than 
anything which can be immediately deduced from the query text.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]




More information about the Lazarus mailing list