Don't suppose you know how to get the name of a function represented by
a reference?   It would make things clean in my head :)

-----Original Message-----
From: Elizabeth Mattijsen [mailto:[EMAIL PROTECTED]] 
Sent: 22 July 2002 19:51
To: Ray Hilton; [EMAIL PROTECTED]
Subject: Re: iThreads and CODE references

At 07:29 PM 7/22/02 +0100, Ray Hilton wrote:
>After significant hair loss, I have come to understand that CODE
>refrences are not sharable in iThreads.  From what I can see, this is
>because each thread will have its own refrence to that function as they
>are all copies.  Ok, fair enough, so what I will need to do is somehow
>retrive the function name, and then pass that onto the other thread, so
>that can recover its reference in its own thread-scope.
>Any ideas on how to do this?  I could pass down the function name
>explicitly, but it seems a bit messy.

That's the only way I know how, really (and _please_ someone correct me
if 
I'm wrong ;-)

You could also send the actual code as source to the other side and
eval() 
it, but that would be _really_ yucky.  Or similarly use Data::Dumper
and/or 
B::Deparse for an already compiled subroutine.

Passing the name of the subroutine is by _far_ the cleanest thing to do
at 
the current state of things.


Liz


Reply via email to