How to use Parallel Computing Toolbox to control access to a file?
7 views (last 30 days)
Show older comments
I have a .mat file that is susceptible to more than one MATLAB client loading in the data, changing the data, and then saving it with the same name. I would ideally like to create a function that will do those operations and then use the Parallel Computing Toolbox (somehow) to run this function. Based on my limited understanding, you can create a job (or future?) to run this function and assign it to one worker. Is it also possible to block it from other workers, or to have other workers check for existing jobs, specifically across different matlab clients?
I essentially want to create a queue to access a file, but I don't have a good enough understanding of the PCT to formulate the best way to accomplish the above.
2 Comments
Raymond Norris
on 3 Feb 2021
To clarify, you want to create a queue of tasks, processed by workers, but they need to be processed one worker at a time, correct? If so, what value is there to have multitude of workers if only one can run at a time as they're all working on the same MAT-file?
Or are you in essence looking to offload the work to another MATLAB process (i.e. worker) to free up your main execution thread?
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!