[fpc-pascal] Best way to check SimpleIPC for messages

noreply at z505.com noreply at z505.com
Fri May 12 16:19:04 CEST 2017


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?

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

Making some progress on the SimpleIPC DLL for any programming language, 
but trying to figure out whether the end user of the dll should create 
his own thread to check for ipc messages, or have the dll do it for him 
to simplify, then fire a callback when message received.



More information about the fpc-pascal mailing list