On Fri, 12 May 2017, nore...@z505.com wrote:

Is the best general way to check IPC messages in SimpleIPC to spawn a thread? and check

I noticed in fpgui sample apps that use simpleipc, graemeg checks the messages in the fpgui OnIdle event, AFAICT, not a separate thread. But what if you are running a console mode program that has no onidle event?

Obviously "avoid threads where possible" but only if there is a simpler mechanism not reinventing a thread. So it seems to me onidle in fpgui is a simpler way than creating a new separate thread yourself, but how to do it in a program that has no fpgui onidle?

Check manually. What else is left ? There is no message queue, so no loop in which to check at regular basis.

On that note what would a lazarus app generally do to check for messages, without locking the app up? A similar OnIdle solution?

Yes. The sample programs check in Application.OnIdle.

Michael.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to