Example Does Not Work
이전 댓글 표시
I try to run the example. The second line of code workerToClient = parallel.pool.PollableDataQueue(Destination="any") gives me this error:
Error using parallel.pool.PollableDataQueue (line 28)
Too many input arguments.
I remove the Destination = "any" argument and that seems to get things working. But then I get to the for-loop in the example:
for idx = 1:5
send(clientToWorker, [idx rand]);
status = poll(workerToClient, inf)
end
and the computer locks up with no output. I force-quite (CTRL-C) and type
future.State
The result is 'finished'. It seems the process stopped and I never sent the stop message. Seems nothing I can do will keep the process running.
댓글 수: 6
Walter Roberson
2025년 11월 26일
parallel.pool.PollableDataQueue(Destination="any")
has been supported only since R2025a.
Walter Roberson
2025년 11월 26일
You did not post enough context for us to be sure that clientToWorker and workerToClient have been created in ways compatible with the default destination.
William
2025년 11월 26일
이동: Walter Roberson
2025년 11월 26일
Walter Roberson
2025년 11월 26일
That example is marked "Since R2025a". It is not expected to work in R2024b.
William
2025년 11월 28일
Walter Roberson
2025년 11월 28일
Sure, you can use poll() with an infinite timeout. https://www.mathworks.com/help/releases/R2024b/matlab/ref/parallel.pool.pollabledataqueue.poll.html
You have to be careful about what you are polling, as there is no Destination="any"
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!