Photon, realtime and Multithread

Hi all

I wrote a real time application and I want to use a GUI to accept input
and show some information to the user.

I start a thread from the main program to initilalize the GUI and
execute PtMainloop.

When I need to update the GUI, i call PtEnter to lock the widget library
, update GUI, then unlock the widget library.

I don’t know if there is a bug with those function or I forget something
because the application alway freeze after a while, specially if I write
some
text in a multitext widget or move the windows. When the application freeze
the CPU gauge go to 100% in the task bar.

Someone have an idea, or know a better way to make a real time
application interact with a GUI.

Best Regard

Jean-Francois Bélisle
Engineer Student

In my opinion, the simplest way to tie a real-time app to the gui is to
have a single threaded gui that uses event notification (pulse) from the
real-time app to the gui. Basically create and arm a pulse from you
photon app, send it to your real-time app, and have your real-time app
deliver the event (MsgDeliverEvent) whenever it feels there is something
of interest for the gui. In the photon apps handler for the pulse,
simply do a send to the real-time app to pick up the new data. There is
a good section in the online docs with details on how to do this.

Jean-Francois Bélisle wrote:

Hi all

I wrote a real time application and I want to use a GUI to accept input
and show some information to the user.

I start a thread from the main program to initilalize the GUI and
execute PtMainloop.

When I need to update the GUI, i call PtEnter to lock the widget library
, update GUI, then unlock the widget library.

I don’t know if there is a bug with those function or I forget something
because the application alway freeze after a while, specially if I write
some
text in a multitext widget or move the windows. When the application freeze
the CPU gauge go to 100% in the task bar.

Someone have an idea, or know a better way to make a real time
application interact with a GUI.

Best Regard

Jean-Francois Bélisle
Engineer Student













\