in reply to need help debugging perl script killed by SIGKILL
In general, when a new thread starts it gets a private copy of each existing variable (see threads::shared). In OS's that utilise copy-on-write (e.g. Linux) the effect of this may not be immediate although Perl does try to make private copies. It's good practice before starting a thread (or 35 of them) destroy all unwanted data from memory.
You mention you are using Thread::Queue. Its doc states in https://perldoc.perl.org/Thread::Queue#DESCRIPTION that
Ordinary scalars are added to queues as they are. If not already thread-shared, the other complex data types will be cloned (recursively, if needed, and including any blessings and read-only settings) into thread-shared structures before being placed onto a queue.
As I understand it, your data going into the queue must be declared :shared otherwise it will be duplicated and then :shared 35 times.
bw, bliako
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: need help debugging perl script killed by SIGKILL
by expo1967 (Sexton) on Mar 02, 2021 at 16:34 UTC | |
by bliako (Abbot) on Mar 02, 2021 at 19:12 UTC |