Re: drb recycled object problem



ara.t.howard@xxxxxxxx wrote:
On Wed, 28 Mar 2007, Brian Candler wrote:

$foo = server.game
DRb.start_service($uri, $foo)

Keeping a reference to the object in global variable $foo is one way to stop
it frm being garbage collected.

A local variable is fine, as long as it doesn't drop out of scope: e.g.

foo = server.game
DRb.start_service($uri, foo)
DRb.thread.join # program waits here

drb itself holds a referent to this, the 'front', object - so i don't think
that'll help too much. i'm guessing the game returns result objects of some
type which are recycled in the server while the client tries to re-use them.

cheers.

-a
Thanks guys. I'll keep these tips in mind while I keep digging through my code, trying to find if I let go of a reference somewhere.

Raj

.



Relevant Pages

  • Re: 7.0 wishlist?
    ... The "auto-implement" is intended mainly for the odd situation where an existing class you can't edit fits some interface and you're willing to take responsibility for it if it turns out not to actually adhere to the contract, and try using it where that interface type is expected. ... If reference declarations started showing up with the odd asterisk, bang, or other punctuation mark on it, but never primitive declarations, people would probably be able to guess what was going on, on the basis of "what other binary flag might be set on references but not primitives and would be really useful besides can be/cannot be null?" ... the compiler cannot prove by static analysis that the RHS isn't null might be a good idea. ... Object foo, bar; ...
    (comp.lang.java.programmer)
  • Re: 7.0 wishlist?
    ... This is a slight modifier that would be very common on reference declarations, so it would be good to economize on typing or visual clutter where it was used. ... which has the enum constants actually singleton instances of same-named subclasses. ... enum Foo ... The point being to allow to publish an interface ...
    (comp.lang.java.programmer)
  • Re: Inheritance of constructors.
    ... Bare in mind that was just for sake of example. ... In case of "reference by value" that's not ... Foo foo = new Foo; ... The changes to the array are visible in Foo, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: C++ design question
    ... >>void DoStuffWithBarBase ... I assumed that the Foo subclasses each had specialized responsibilities, ... policies for object and relationship instantiation (object ... conditional one can't implement it with a reference. ...
    (comp.object)
  • Re: How to undo a bless on a GLOB
    ... The reference was blessed to something: ... bless $foo, 'Something'; ... Can you bless the glob before ... That could be a bug in POE. ...
    (comp.lang.perl.misc)