Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2001-09

My application is making my system less responsive

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Unknown author

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?

Barry Samuels

Marco van de Voort
to Unknown author
Show quoted text 16 lines
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);
Unknown author
to Marco van de Voort
Show quoted text 25 lines
> 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);

Thanks for your reply but I cannot find any reference to usleep, nanosleep or any other sleep in the Free Pascal documentation.

Barry Samuels

Marco van de Voort
to Unknown author
Show quoted text 12 lines
> > 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); Thanks for your reply but I cannot find any reference to usleep, nanosleep or any other sleep in the Free Pascal documentation.

Linux.NanoSleep doesn't seem to be in the docs, but it exists. As far as I can tell from CVS logs also in 1.0.4

First and only argument is the time in microseconds.