in reply to
Postpone garbage collection during a child process run?
You don't show much relevant code, and you don't tell us much about the environment you're working with, so I'm going to make some assumptions:
- You're using threads
- You're passing around references and these references point to things that already are visible to more than one thread, and potentially shared.
This is problematic as the threads will see the references pointing to the same thing and then stomp on each others values.
You could have shown the relevant code of the "subroutine that makes $accptr vanish", but you chose not to. Perl has reference counting and no garbage collection, so things don't simply vanish. You have a logic error somewhere.
As a remedy, I would look into using a Thread::Queue to hand off jobs to worker threads. This will force you to avoid global variables for passing information and it will properly clone information across threads so they don't step on each others toes.