semuel has asked for the wisdom of the Perl Monks concerning the following question:
Now came the requirement for threading. this said object creates threads as workers.
To my suprize, I found out that the object itself is being copied to the worker threads, and destroyed then they are destroyed.
How can it be? I scanned my code, and I don't keep this object ref inside Perl, but in SV* on the C side. I thought that it is completely safe there.
How do I protect my SVs so Perl won't duplicate them when it create a thread?
(in perl it's easy. just make sure it's not a global)
Thanks,
Shmuel.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Protecting External Data?!
by plobsing (Friar) on Dec 20, 2007 at 01:16 UTC | |
by diotalevi (Canon) on Dec 20, 2007 at 01:52 UTC | |
by semuel (Novice) on Dec 20, 2007 at 06:20 UTC | |
by plobsing (Friar) on Dec 20, 2007 at 07:04 UTC | |
by semuel (Novice) on Dec 22, 2007 at 18:13 UTC | |
by plobsing (Friar) on Dec 23, 2007 at 05:10 UTC |