I\'ve a scenario like this: I\'ve created an object of the class element containing a semaphore.
import multiprocessing as mpr
class Element(object):
de
I don't think you understood how the multiprocessing
module works.
When you send something through the pipe, it gets pickled and then unpickled in the subprocess. This means that the subprocess actually has a copy of the original object! That's why the change is "lost". Adding a semaphore wont change anything.
If you want an object in shared memory you should use multiprocessing.Value, even though this does not handle arbitrary types. Probably multiprocessing.Manager is what you are looking for.
An other way would be to send a response to the main process providing the modified object.