[fpc-pascal]My application is making my system less responsive

Marco van de Voort marcov at stack.nl
Wed Sep 5 13:24:51 CEST 2001

> I am writing an application for backing up, to and restoring from, a
> tape streamer which uses Afio for backup and the Forms library for the
> user interface.
> In order to display files within a tape archive I am using POpen() in
> conjuction with Afio -tv.  Using a 'While' loop I read each filename 
> output by afio with ReadLn() and display it in a browser.
> Whilst the loop is active CPU usage is high, movement of the mouse
> pointer becomes a bit jerky and, if the pointer is moved over the
> browser listing, it flickers so much it is barely visible.
> I do use fl_check_forms within the loop but it doesn't seem to help
> much.
> Is there something I can do to alleviate the problem?

Add a usleep (unit linux I hope, otherwise it is called nanosleep) to the
loop. E.g. usleep(50000);

More information about the fpc-pascal mailing list