The need has arisen to make the draw() function the run function of a consumer thread that receives from a producer thread, as is demonstrated in this example:
In my application the producer thread reads data from a serial bus, and then I need the draw function to execute its loop to act on it, and display the data.
I also need the draw function to display more than the data from the serial bus, and to update the user interface whenever that is ready also. Hence the need for multiple threads.
I would need the draw() function to be that consumer thread’s run() function, and would need a wait() function in the draw loop to wait for a notification. In the example linked to above the synchronization object is
taskQueue. In a sketch, since draw() is already a thread, would it work to create only, say, a
taskQueue synchronization object, then an additional producer thread using that ‘taskQueue’ object, and within the draw function, call