throwTo and block

Chris Kuklewicz haskell at list.mightyreason.com
Tue Feb 6 07:00:12 EST 2007


Hi,

  I have just signed up for this cvs-ghc mailing list.  As I had mentioned on
another mailing list, I want to look at how unblock and throwTo interact in GHC.

The goal is to implement the semantics presented in the original paper, in
particular the critical guarantees of section 7.2 (in that paper).

My OS X laptop is a bit slow for compiling GHC all the time, so I am setting up
a ghc development environment on Windows XP (it is a Core Duo 2 Dell/Intel box).

I want to ask for help with two things:

First is the obligatory "GHC HEAD is not compiling for me" problem.  I have
mingw and cygwin installed and followed the ghc on windows instructions to
--use-gcc the c:/MinGW/bin/ compiler (and I have all the cygwin ghc-dependencies
along with a fresh compile of happy and alex).  And the compilation gets pretty
far until this occurs:

> 
> ------------------------------------------------------------------------
> == make boot -wr -f Makefile;
>  in /home/User/build/ghc-top/ghc-darcs/ghc/libraries/Win32
> ------------------------------------------------------------------------
> ../../utils/ghc-pkg/ghc-pkg-inplace update - --force-files <package.conf.inplace
> 
> Reading package info from stdin ... done.
> cannot find libHSWin32.a on library path (ignoring)
> Saving old package config file... done.
> Writing new package config file... done.
> ../../utils/ghc-pkg/ghc-pkg-inplace update - -f ../../driver/package.conf --forc
> e-files <package.conf.installed
> Reading package info from stdin ... done.
> Saving old package config file... done.
> Writing new package config file... done.
> ../../utils/hsc2hs/hsc2hs-inplace -Iinclude -I.    System/Win32/Info.hsc
> System\Win32\Info.hsc: In function `main':
> System\Win32\Info.hsc:131: `PROCESSOR_ARCHITECTURE_IA32_ON_WIN64' undeclared (fi
> rst use in this function)
> System\Win32\Info.hsc:131: (Each undeclared identifier is reported only once
> System\Win32\Info.hsc:131: for each function it appears in.)
> System\Win32\Info.hsc:133: `PROCESSOR_ARCHITECTURE_AMD64' undeclared (first use
> in this function)
> compiling System\Win32\Info_hsc_make.c failed
> command was: c:/mingw/bin/gcc -c -mno-cygwin -D__GLASGOW_HASKELL__=607 -IC:\cygw
> in\home\User\build\ghc-top\ghc-darcs\ghc/includes -Iinclude -I. System\Win32\Inf
> o_hsc_make.c -o System\Win32\Info_hsc_make.o
> make[2]: *** [System/Win32/Info.hs] Error 1
> make[1]: *** [boot] Error 1
> make[1]: Leaving directory `/home/User/build/ghc-top/ghc-darcs/ghc/libraries'
> make: *** [stage1] Error 2
> 
> User at PAPC-QOP-1 ~/build/ghc-top/ghc-darcs/ghc
> $

I can hack around compilation problems in unix environments but I don't know the
best way to diagnose and fix an error like this on windows.

Thus question 1 is: Does anyone know how to fix this?

I may go get the official 6.6 release source to see if it compiles, to check if
it is a generic problem or a problem with HEAD.


The second question is in two parts:

2.1: Where is the throwTo and unblock code in the source tree?  I can find bits
of it, but the "commentary" page I looked at was blank.

Of particular interest is:
http://darcs.haskell.org/ghc/rts/Exception.cmm
which has a comment near the top:

>    A thread which wants to raise an exception in another thread (using
>    killThread#) must block until the target thread is ready to receive
>    it.  The action of unblocking exceptions in a thread will release all
>    the threads waiting to deliver exceptions to that thread.

That comment is not true for the released ghc.  It described the semantics of
section 7.2 of the paper, but ghc did not provide this guarantee.

2.2: Is this comment old and wrong or has ghc HEAD been "fixed" already?

-- 
Chris



More information about the Cvs-ghc mailing list