How to use Parallel Computing Toolbox to control access to a file?
7 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Raymond Norris
2021 年 2 月 3 日
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?
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!