If you get it in the queue, you should be able to close it and the release it 
afterwords it should be collected

Regards,
Kirk

On Nov 19, 2010, at 6:50 PM, Charles Oliver Nutter wrote:

> On Fri, Nov 19, 2010 at 2:05 AM, David MacIver <[email protected]> wrote:
>> One solution you could use here is to use a weak reference on the
>> original channel object instead of a finalizer and have a background
>> thread (you're already running one for the JIT or something like that,
>> right?) polling a reference queue and closing channel objects there:
>> That way channels seen by ruby would be automatically closed, but not
>> until *any* code that might be using them was done with them, not just
>> the wrapping ruby code.
> 
> In order for the WeakReference to show up in the queue, the Channel it
> references would have to get collected...in which case I would no
> longer be able to close it. Am I missing something?
> 
> Now, if I had access to the actual fileno and the APIs that OpenJDK
> uses to open and close them, this would not be a problem at all. But
> of course all that stuff is hidden from me.
> 
> - Charlie
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "JVM Languages" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/jvm-languages?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en.

Reply via email to