in reply to Thread::Queue and objects
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Thread::Queue and objects
by bronto (Priest) on Jan 14, 2005 at 14:14 UTC | |
by BrowserUk (Patriarch) on Jan 14, 2005 at 18:40 UTC |