Works well, thanks!
It does consume a fair bit amount of memory though. Since "random access constant data" seems to be the most common model for many data-intensive applications, it would be great if Matlab somehow supports read-only shared memory across labs in the future.
22 Jan 2014
Worker Object Wrapper
Simplifies managing resources such as large data within PARFOR loops and SPMD blocks
Hi Matt, calling "clear" inside SPMD is not necessary - that's not the problem. Because of the way Composites work, when they go out of scope the workers don't find out immediately, only on the next SPMD block. If you add an SPMD block to your function, that's not sufficient since that happens before the Composites are created during the WorkerObjWrapper deletion.
Next suggestion: try adding the following line
val = ; dtor = ; valdtor = ;
as the last line inside the SPMD block in workerDelete.