Thanks to everyone who has contributed to this discussion so far. Since there are a lot of subtle points to be considered at once, I thought I'd try to write a summary of the issues raised so far. I'll put something in the repository so we can all hack on it. Hopefully I'll have something ready later today. Cheers, Simon
Thanks to everyone who has contributed to this discussion so far. Since there are a lot of subtle points to be considered at once, I thought I'd try to write a summary of the issues raised so far.
I'll put something in the repository so we can all hack on it. Hopefully I'll have something ready later today.
I've added a finalizer rationale document to the repository, under haskell-report/ffi (i.e. the same place as the FFI spec). If you have CVS commit privs, please feel free to modify it, or otherwise suggest changes on this list. It's not quite finished, but I'm going a bit bleary-eyed so I thought I'd give others a chance to bash it around a bit. Cheers, Simon
"Simon Marlow" <simonmar@microsoft.com> wrote,
I've added a finalizer rationale document to the repository, under haskell-report/ffi (i.e. the same place as the FFI spec). If you have CVS commit privs, please feel free to modify it, or otherwise suggest changes on this list.
Thanks a lot for the summary. To be honest, by now I am convinced that the Right Thing is to revert back to Haskell finalizers. Reasons: * 2 out of 3 systems regard Haskell finalizers as a non-issue to implement and there exists a prototype implementation for the 3rd system. * Everybody except Alastair seems in favour of reverting back to Haskell finalizers. * Alastair's main counter argument appears to be - potential to introduce race conditions - potential for deadlock We need to place a side condition on what a Haskell finalizer may do (ie, not update IORef's) in the same way as we would have to place side conditions on what a C finalizer may do (ie, not call back into Haskell). So, I am going to revert the spec back to Haskell finalizers for the next RC. I agree with Alastair that we need to add to the spec at the same time a precise statement about what Haskell finalizers are allowed to do (or not do). Manuel
Thanks to everyone who has contributed to this discussion so far. Since there are a lot of subtle points to be considered at once, I thought I'd try to write a summary of the issues raised so far.
I'll put something in the repository so we can all hack on it. Hopefully I'll have something ready later today.
oops, I should have mentioned that if you just want to read the document, it will be available here: http://cvs.haskell.org/cgi-bin/cvsweb.cgi/haskell-report/ffi/finalizers. txt just as soon as the CVS web server updates its repository. Cheers, Simon
I dont have cvs write access but you should mention something about expressing gc dependencies between ForeignPtr's. the only two ways to do this in the current haskell systems are * weak pointers * touchForeignPtr from the finalizer of another ForeignPtr if the second one is not allowed by restricting us to C only finalizers, then the first needs to be added into the FFI, (or some other mechanism invented). I consider this functionality vital for any non-trivial use of ForeignPtr, and it becomes more important as we move more stuff to C land, as C structures become more common. for more info on the use of this, see the FFI touchForeignPtr documentation and the paper describing Weak pointers in ghc. the fact that multiple people saw the need for this and came up with solutions probably says something about its usefulness. John On Mon, Oct 14, 2002 at 06:16:05PM +0100, Simon Marlow wrote:
Thanks to everyone who has contributed to this discussion so far. Since there are a lot of subtle points to be considered at once, I thought I'd try to write a summary of the issues raised so far.
I'll put something in the repository so we can all hack on it. Hopefully I'll have something ready later today.
oops, I should have mentioned that if you just want to read the document, it will be available here:
http://cvs.haskell.org/cgi-bin/cvsweb.cgi/haskell-report/ffi/finalizers. txt
just as soon as the CVS web server updates its repository.
Cheers, Simon
_______________________________________________ FFI mailing list FFI@haskell.org http://www.haskell.org/mailman/listinfo/ffi
-- --------------------------------------------------------------------------- John Meacham - California Institute of Technology, Alum. - john@foo.net ---------------------------------------------------------------------------
participants (3)
-
John Meacham -
Manuel M T Chakravarty -
Simon Marlow