GHC 6.4.3 on FreeBSD
Simon Marlow
simonmar at microsoft.com
Mon Aug 7 10:12:19 EDT 2006
An update on the GHC/FreeBSD front: I didn't manage to reproduce the
reported threading bugs on a UP, will be trying on a MP shortly.
However, I did discover one odd case that libpthread doesn't appear to
handle properly, but libthr does. This arose from a test in GHC's test
suite, but I've transliterated the code from Haskell to C:
$ cat thr1.c
#include <unistd.h>
#include <signal.h>
#include <pthread.h>
int main(int argc, char *argv[])
{
sigset_t s;
sigemptyset (&s);
sigaddset(&s, SIGUSR1);
sigprocmask(SIG_BLOCK, &s, NULL);
pthread_kill(pthread_self(), SIGUSR1);
sigpending(&s);
printf("%x\n", s);
exit(0);
}
$ gcc -pthread thr1.c
$ ./a.out
0
$ gcc -lthr thr1.c
$ ./a.out
20000000
$
This might (or might not) be related to the other threading issues with
GHC on FreeBSD.
Do you think we should link with -lthr by default on FreeBSD? This
would be a trivial change to make, and given that GHC has its own
lightweight threading runtime, we probably aren't getting much from
having the KSE-based threading implementation anyway.
Cheers,
Simon
More information about the Glasgow-haskell-users
mailing list