Don't ask to ask, just ask | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I am going to have no luck with this approach, am I? The best answer I can give is that I haven't succeeded in doing this--and I have tried quite hard. I think that the documentation for Thread::Queue (and much of the other threads-related documentation) still has some vestigies of the original 5.6.x pthreads information lingering. I did read somewhere (not on this site I think), that it is possible to re-bless an object into a different thread. Apart from that threads::shared will not allow you to share blessed references, theoretically you ought to be able to have a copy of the class loaded in two threads and by re-blessing an object reference created in one, into the other, have both threads access copies of the same object. I see all manner of problems with synchronisation and locking inherent in this. I did make a half-hearted attemt to verify this was possible, but I got nowhere. Again, it could be that what I read was only applicable to pthreads not iThreads. What is the problem you are encountering with the current method? If you do find another way, please post it here. Thanks. Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.
In reply to Re: Thread::Queue and objects
by BrowserUk
|
|