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

2017-05-21 Thread noreply
On 2017-05-16 04:55, Michael Schnell wrote: On 16.05.2017 07:30, Michael Van Canneyt wrote: select is basically what peekmessage does. AFAIK "select()" (and - more versatile - "poll()" ) in Linux uses an appropriate system call to wait on one of multiple events (i.e. devices, including

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

2017-05-20 Thread Michael Schnell
On 17.05.2017 07:08, nore...@z505.com wrote: what happens when the application is not idle, but sort of idle? A new Queue event also only is serviced when no other previous events are peresent hence when the application gets "idle". I don't know when exactly "OnIdle" is called. It can't be

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

2017-05-17 Thread Michael Schnell
On 16.05.2017 07:30, Michael Van Canneyt wrote: select is basically what peekmessage does. AFAIK "select()" (and - more versatile - "poll()" ) in Linux uses an appropriate system call to wait on one of multiple events (i.e. devices, including e.g. pipes, which might be used by IPC).

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

2017-05-17 Thread Mattias Gaertner
On Wed, 17 May 2017 01:50:32 -0500 nore...@z505.com wrote: > On 2017-05-17 00:54, Sven Barth via fpc-pascal wrote: > > OnIdle() is called when there is no more event waiting in the > > widgetset's event queue, basically meaning that the application has > > nothing better to do anyway. It has

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

2017-05-17 Thread noreply
On 2017-05-17 00:54, Sven Barth via fpc-pascal wrote: OnIdle() is called when there is no more event waiting in the widgetset's event queue, basically meaning that the application has nothing better to do anyway. It has nothing to do with CPU usage. That makes sense. And recursively what

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

2017-05-16 Thread Sven Barth via fpc-pascal
Am 17.05.2017 07:08 schrieb : > > On 2017-05-15 04:36, Michael Schnell wrote: >> >> On 12.05.2017 16:37, Michael Van Canneyt wrote: >>> >>> >>> Check manually. What else is left ? There is no message queue, so no loop in which to check at regular basis. >>> >> For event

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

2017-05-16 Thread Michael Schnell
On 12.05.2017 16:37, Michael Van Canneyt wrote: Check manually. What else is left ? There is no message queue, so no loop in which to check at regular basis. For event processing in a not threaded project or in the main thread of a threaded project you at best use the Event Queue provided

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

2017-05-15 Thread Michael Van Canneyt
On Mon, 15 May 2017, nore...@z505.com wrote: On 2017-05-12 09:37, Michael Van Canneyt wrote: 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

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

2017-05-15 Thread noreply
On 2017-05-12 09:37, Michael Van Canneyt wrote: 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

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

2017-05-12 Thread Michael Van Canneyt
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