Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Math Forum
»
Discussions
»
Software
»
comp.softsys.matlab
Notice: We are no longer accepting new posts, but the forums will continue to be readable.
Topic:
Making C++ objects persistent between mex calls, and robust.
Replies:
38
Last Post:
Aug 5, 2017 8:06 PM




Re: Making C++ objects persistent between mex calls, and robust.
Posted:
Jan 31, 2013 6:56 AM


"Gabri Gwala" wrote: > Many thanks to Oliver Woodford and all the other contributors of this effective strategy. Anyway I would like to submit a potential issue when using Matlab Parallel Computation Toolbox. In particular i'm trying to use this scheme inside a parfor, obtaining a segmentation fault while trying to convert a matlab handle in C++ pointer. > Since this is not a pure Matlab topic, I posted the detailed question on stackoverflow. > > http://stackoverflow.com/questions/14607109/matlabcsegmentationfaultonparallelcomputingwithcmexpersistentobj > > Regards, > Gabriele Gualandi
If all your workers are threads on the same computer then you might be able to solve the problem by making the class instance and all the memory allocated by it in shared memory, e.g. by using the approach described here: http://www.boost.org/doc/libs/1_51_0/doc/html/interprocess/sharedmemorybetweenprocesses.html
If the workers are on different computers, then, as Steve points out, this won't work.



