Concurrent programming. GUI Multithread and timer multithread

7 次查看(过去 30 天)
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.

回答(1 个)

Walter Roberson
Walter Roberson 2015-6-26
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.

类别

Help CenterFile Exchange 中查找有关 Parallel Computing Fundamentals 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by