Re: [fpc-pascal] How to find where my app consumes CPU?

2021-05-18 Thread Martin Frb via fpc-pascal
On 19/05/2021 00:29, Bo Berglund via fpc-pascal wrote: While not (bSTerm or bSInt or bsHup) do begin //Here is where the server runs as defined elsewhere //Eternal loop to wait for system messages Sleep(1); //To not hog the CPU CheckSynchronize;

Re: [fpc-pascal] How to find where my app consumes CPU?

2021-05-18 Thread Alexander Grotewohl via fpc-pascal
https://www.freepascal.org/docs-html/rtl/baseunix/fpsigtimedwait.html there we go :) i think this should do the trick. might need to rearrange some things though.. -- Alexander Grotewohl https://dcclost.com From: fpc-pascal on behalf of Bo Berglund via

Re: [fpc-pascal] How to find where my app consumes CPU?

2021-05-18 Thread Travis Siegel via fpc-pascal
Apparently, you can release cpu cycles, but it's with the sched_yield (section 2 in the man pages), not the sleep command on linux. So, apparently, the sleep is still using full system recourses, even though it's just waiting.  You apparently have to release cpu time with the sched_yield

Re: [fpc-pascal] How to find where my app consumes CPU?

2021-05-18 Thread Bo Berglund via fpc-pascal
On Tue, 18 May 2021 21:40:15 +, Alexander Grotewohl via fpc-pascal wrote: >if it's waiting on keyboard input you might be better off using select() for >that instead of looping and checking for keyboard input each go around. > >sleep() might already do something similar with a zero timeout

Re: [fpc-pascal] How to find where my app consumes CPU?

2021-05-18 Thread Alexander Grotewohl via fpc-pascal
if it's waiting on keyboard input you might be better off using select() for that instead of looping and checking for keyboard input each go around. sleep() might already do something similar with a zero timeout but even that would probably be insufficient -- Alexander Grotewohl

Re: [fpc-pascal] How to find where my app consumes CPU?

2021-05-18 Thread Travis Siegel via fpc-pascal
I'm not positive, but I'm pretty sure the sleep command in linux does not behave the same way it does in windows. As you know, in windows, a sleep command (even if delivered with a parameter of 0) gives up time slices to other programs on the system.  This does not appear to be the case on

Re: [fpc-pascal] How to find where my app consumes CPU?

2021-05-18 Thread Bo Berglund via fpc-pascal
On Tue, 18 May 2021 21:59:33 +0200, Bo Berglund via fpc-pascal wrote: >This is working seemingly OK, but today when I checked the RPi I found using >top >that it was running 11% CPU, which is strange because it has nothing to do at >the moment. > >I have tried to be as conservative as possible

[fpc-pascal] How to find where my app consumes CPU?

2021-05-18 Thread Bo Berglund via fpc-pascal
I have a pretty sizable console app written with Delphi 15 years ago but ported to Linux using FreePascal (3.2.0) with Lazarus (2.0.12) as IDE. It runs as a systemd service on a Raspberry Pi3. Basically it is a scheduler, which checks every minute if there is a task to run, otherwise it waits for

Re: [fpc-pascal] FTP support gone - switch to HTTP ?

2021-05-18 Thread Tomas Hajny via fpc-pascal
On 2021-05-18 18:01, Bo Berglund via fpc-pascal wrote: On Tue, 18 May 2021 16:20:29 +0100, Henry Vermaak via fpc-pascal wrote: On Tue, 18 May 2021 at 11:50, Sven Barth via fpc-pascal wrote: I don't think we need to mention any specific clients (and why did your list not include Filezilla?

Re: [fpc-pascal] FTP support gone - switch to HTTP ?

2021-05-18 Thread Bo Berglund via fpc-pascal
On Tue, 18 May 2021 16:20:29 +0100, Henry Vermaak via fpc-pascal wrote: >On Tue, 18 May 2021 at 11:50, Sven Barth via fpc-pascal > wrote: > >> I don't think we need to mention any specific clients (and why did your list >> not include Filezilla? :P ) > >Because FileZilla bundles adware when you

Re: [fpc-pascal] FTP support gone - switch to HTTP ?

2021-05-18 Thread Henry Vermaak via fpc-pascal
On Tue, 18 May 2021 at 11:50, Sven Barth via fpc-pascal wrote: > I don't think we need to mention any specific clients (and why did your list > not include Filezilla? :P ) Because FileZilla bundles adware when you download from the homepage? Would actually be good to warn _against_ using it.

Re: [fpc-pascal] FTP support gone - switch to HTTP ?

2021-05-18 Thread Sven Barth via fpc-pascal
Tomas Hajny via fpc-pascal schrieb am Di., 18. Mai 2021, 11:44: > On 2021-05-18 10:38, Michael Van Canneyt via fpc-pascal wrote: > > On Tue, 18 May 2021, Graeme Geldenhuys via fpc-pascal wrote: > > > >> > >> On 17/05/2021 3:13 pm, Karoly Balogh via fpc-pascal wrote: > >>> I'd actually keep > >>>

Re: [fpc-pascal] FTP support gone - switch to HTTP ?

2021-05-18 Thread Tomas Hajny via fpc-pascal
On 2021-05-18 10:38, Michael Van Canneyt via fpc-pascal wrote: On Tue, 18 May 2021, Graeme Geldenhuys via fpc-pascal wrote: On 17/05/2021 3:13 pm, Karoly Balogh via fpc-pascal wrote: I'd actually keep FTP enabled, as it doesn't hurt anything and it's still a thing for retro downloads.

Re: [fpc-pascal] FTP support gone - switch to HTTP ?

2021-05-18 Thread Michael Van Canneyt via fpc-pascal
On Tue, 18 May 2021, Graeme Geldenhuys via fpc-pascal wrote: On 17/05/2021 3:13 pm, Karoly Balogh via fpc-pascal wrote: I'd actually keep FTP enabled, as it doesn't hurt anything and it's still a thing for retro downloads. Not just "retro" but a more efficient and faster protocol for file

Re: [fpc-pascal] FTP support gone - switch to HTTP ?

2021-05-18 Thread Graeme Geldenhuys via fpc-pascal
On 17/05/2021 3:13 pm, Karoly Balogh via fpc-pascal wrote: > I'd actually keep > FTP enabled, as it doesn't hurt anything and it's still a thing for retro > downloads. Not just "retro" but a more efficient and faster protocol for file downloads. Unfortunately the whole world is going HTTP crazy

Re: [fpc-pascal] Dependency of OpenSSL 1.0.2 still in FPC 3.2.0 on some platforms?

2021-05-18 Thread Bo Berglund via fpc-pascal
On Tue, 18 May 2021 00:25:51 +0200 (CEST), Michael Van Canneyt via fpc-pascal wrote: >> Follow-on question: >> Do I have to install dev packages like this on the target system as well >> (one >> where the application is not going to be built on? >> >> Or is it only needed to be on the

Re: [fpc-pascal] Dependency of OpenSSL 1.0.2 still in FPC 3.2.0 on some platforms?

2021-05-18 Thread Michael Van Canneyt via fpc-pascal
On Mon, 17 May 2021, Travis Siegel via fpc-pascal wrote: The -dev part of the package is necessary for the headers used for compiling, any target system running the finished product will not require the -dev version of the packages to be installed, since they won't be using the header files