Jez White said:
> The question is what is the best way to get this text in the worker SV's
> over to the user interface thread? At the moment I'm using a brute force
> approach (creating a new char pointer and coping the SV contents) but it's
> not exactly efficient:)

My gut says that since you have multiple interpreters running, they'll each
have their own heaps, so passing SVs around is doomed to failure.  Don't do
it.

Your choices are either to copy the data out of the perl heap (which it sounds
like you're already doing), have the data never exist in the perl heap in the
first place (e.g. custom logging functions that use libc instead of SV
memory), or use pipes to communicate between your threads and let the kernel
do the copying for you.

Depending on what you're using for the gui, watching a pipe should be cheap
and easy, and relatively free of thread synchronization issues.


-- 
muppet <scott at asofyet dot org>

Reply via email to