I have an application where a service is collecting data from a bluetooth source (using AsyncStreams). The data is to be processed and displayed on a bitmap which can, depending on the latest data values, take some time to redraw - on occasions longer than the interval between BT updates.
I presume that the service can pre-empt the GUI code so it is not particularly safe to use a global map or list where the service adds data and the GUI reads and displays it.
Is there a locking mechanism that I can use or should I send new packets of data to the GUI using callsubdelayed and hope that the GUI does not get too many packets behind the data gathering?
I presume that the service can pre-empt the GUI code so it is not particularly safe to use a global map or list where the service adds data and the GUI reads and displays it.
Is there a locking mechanism that I can use or should I send new packets of data to the GUI using callsubdelayed and hope that the GUI does not get too many packets behind the data gathering?