Concurrent programming. GUI Multithread and timer multithread

16 views (last 30 days)
Mario Rubio Gómez
Mario Rubio Gómez on 26 Jun 2015
Answered: Walter Roberson on 26 Jun 2015
Hello there.
I have some questions about multithreading. I am doing a project based on Maltlab GUI, using many functions, global variables and two timers. The thing is I call different functions inside others and I want them to execute concurrently. The same thing happens with the timer, I want it to work alone in a thread so the programm can continue doing the statements and even calling another function to be executed in other thread.
I do not know if this is possible on Matlab, I have looked up a little about the parallel toolbox but I dont know if using some of these functions will work the way I am trying to do the GUI.
Any help will be gratefully accepted.

Answers (1)

Walter Roberson
Walter Roberson on 26 Jun 2015
There is a fundamental limitation that all graphics operations must be done in the same Java thread, so graphics callbacks effectively get single-threaded (or at least did in the past). Graphics operations cannot be distributed through the Parallel Computing Toolbox
My understanding is that for any one worker, timers are also single threaded, but I gather that different workers can have different timers. Also, timers can interrupt graphics callbacks.
spmd with its message passing might possibly be the best concurrent model for you to investigate.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!