How to implement semaphore concept in Matlab?
14 ビュー (過去 30 日間)
古いコメントを表示
Is this possible to implement semaphore concept in matlab? Kindly give some explanation which will be very useful for my project.
2 件のコメント
回答 (1 件)
Walter Roberson
2018 年 2 月 27 日
You have no parallel code as you have no parfor or spmd or batch or parfeval or parfevalOnAll
You use labindex which is not valid for parfor but it is valid for spmd. If you are using spmd then the tool for semaphore is effectively to use labBarrier()
2 件のコメント
Walter Roberson
2018 年 2 月 27 日
You appear to expect exactly two workers. You should specify the number of workers when you create the parpool as the default is the number of physical cores and even if your setup only has two cores other people running the code might have more.
参考
カテゴリ
Help Center および File Exchange で Distributed Arrays についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!