in reply to Trying to share a Moose object between some threads
From what I see in threads::shared, "Shared variables can only store scalars, refs of shared variables, or refs of shared data" ... which means you need to share every reference on down. Apparently, CODE references can't be cloned (makes sense).
Try Coro instead of threads ;-) Does not suffer from any of the above issues. Also does not do true threads, which is how it avoids the above issues. Mind you, I've heard recently that 5.10+ is recommended for Coro.
|
|---|