Wolfgang Thaller
Wed, 23 Jul 2003 00:27:32 +0200

> That, along with your HSrts.o later, ties in with the files that change
> file size except that /usr/lib/ghc-6.0/package.conf gains a "pthread" 
> in
> the rts extra libraries.

Ah yes, I overlooked that, because it doesn't happen on Mac OS X :-).

> It looks like I want to make a package-threaded.conf that thinks the 
> rts
> package is 'hs_libraries = ["HSrts-threaded"],' which I install into 
> the
> same directory [...]

Something like that, I guess.

>> As for the .hi files... no idea why they should be different, the
>> configure flag absolutely positively doesn't affect how the libraries
>> are built - do the hi files perhaps contain a timestamp or something
>> else that might change on its own?
> Could be - looking at one of the .a files at random (libHSposix.a) it
> looks like it is the timestamps of the files inside it that has
> changed.
> FWIW the .hi differences on /usr/lib/ghc-6.0/imports/GHC/Int.hi are:
> (again chosen at random) (note that these are not contiguous)

I don't see anything here.

> One more thing - is there an easy way to check to see if it has worked?
> I assume a Haskell program can't tell whether or not it is being run in
> a threaded-rts? I have access to a dual-CPU machine so I can time 
> things
> with and without if that makes sense.

Dual-CPU doesn't help, as the threaded RTS still only runs one Haskell 
thread at a time (SMP is a lot harder). However,

import Foreign

foreign import ccall sleep :: Int -> IO () -- slightly wrong signature, 
but still works :-)

main = do
     forkIO $ sequence_ $ repeat $ putStrLn "Hello, world."
     sleep 10

If the above program prints "Hello, world." like mad for 10 seconds, 
it's the threaded RTS; if it prints it at most a few times and then 
stops for 10 seconds, it's the non-threaded RTS.

Hope that helps,