Clear Filters
Clear Filters

Multithreading using a listdlg() for a decision request

2 views (last 30 days)
Hello,
I want to make a very small parallel computing and I m new to this, dont know how to start
I display a listdgl() that will show me a list of options that I have to choose. What I want is to measure the time since the dialogbox window was opened and choose automatically the first option after 10 min in case the user is away from computer and didnt choose any option.
So I will need a thread to open the listdlg and another thread to start the timer.
At some point, if timer > 600(seconds) -> choose first option and close listdlg
I was reading about parfor, but to my understanding, the parallel functions inside parfor need to be similar, so it didnt quite help.
The question is how to make something like this? Any tips will help
Hope I was clear. Thanks :)

Answers (1)

Abhimenyu
Abhimenyu on 25 Sep 2023
Hi Claudia,
I understand that you want to use the MATLAB parallel computing toolbox for coding your problem.
I would suggest the use of a simple timer function to execute the task. It can give you similar results without multithreading.
The spmd function in the MATLAB parallel computing toolbox can be used to run two parallel and independent pool processes. However, in this case, the dialog box is a visible GUI process that only runs on the main thread. Hence the timer function is the best alternative.
Thank you,
Abhimenyu.

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R2020b

Community Treasure Hunt

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

Start Hunting!