GC finalization actually works for SilkJS. In the HTTP server, there are two nested loops. The outer loop waits for connections, the inner loop handles keep-alive requests. At the end of the inner loop (e.g. when the connection is about to be closed), I force a GC (or at least try to).
But there still isn't a good way from JS code to register a finalize sort of method. The thing is, it really shouldn't matter of implementing such a thing is part of the ECMA specs or anything like that. I don't know that client-side code would particularly make use of the feature. Given that I know 100% of the time my server-side code is running in V8, I don't have to worry about the feature being present - it always would be. On Jul 11, 2012, at 5:50 AM, Andreas Rossberg wrote: > On 11 July 2012 14:32, mschwartz <[email protected]> wrote: > You left out the best part of my last post. I'll try again, but this time > with a more concrete example. > > Yes, there are plenty of use cases that I could imagine. It's a well-known > issue, and has been for decades. But unfortunately, that does not change the > fundamental problem: there is no magic by which any runtime could efficiently > provide the behaviour you want. GC-time finalization is as close as you can > get. > > /Andreas > > > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
