Re: ForeignPtr and -threaded

2007-07-23 Thread PHO
From: Ian Lynagh <[EMAIL PROTECTED]> Subject: Re: ForeignPtr and -threaded Date: Mon, 23 Jul 2007 09:22:01 +0100 > That's a documentation bug. In the HEAD it says: > > newForeignPtr :: FinalizerPtr a -> Ptr a -> IO (ForeignPtr a) > -- ^Turns a plain memory referenc

Re: ForeignPtr and -threaded

2007-07-23 Thread Ian Lynagh
On Mon, Jul 23, 2007 at 11:07:40AM +0900, PHO wrote: > > same. The documentations of both Foreign.ForeignPtr (*1) and > Foreign.Concurrent (*2) say "The only guarantee is that the finalizer > runs before the program terminates." That's a documentation bug. In the HEAD it says: newForeignPtr :: F

Re: ForeignPtr and -threaded

2007-07-22 Thread PHO
From: Bulat Ziganshin <[EMAIL PROTECTED]> Subject: Re: ForeignPtr and -threaded Date: Sun, 22 Jul 2007 17:48:05 +0400 > try to add performGC at end - this should force collecting garbage and > therefore printing of string. otherwise, it's ok - there is no guarantee > that GC w

Re: ForeignPtr and -threaded

2007-07-22 Thread Bulat Ziganshin
Hello PHO, Sunday, July 22, 2007, 5:36:27 PM, you wrote: > [2] Foreign.ForeignPtr > The following code prints nothing when it isn't linked with -threaded > RTS, but when it is, it *sometimes* prints "called" but not always. > import Foreign.Marshal.Alloc > import Foreign.Ptr > import Foreign.Fo

ForeignPtr and -threaded

2007-07-22 Thread PHO
Hi, I have encountered a weird behavior of ForeignPtr. I want to know how to work around this. I am using GHC 6.6.1 on Darwin. [1] Foreign.Concurrent The following code prints "called" when it is linked with -threaded RTS, but it prints nothing when it isn't. import Foreign.Marshal.Alloc impor