[Mono-list] mono and NGPT pthreads on linux

Marijn Ros marijn@mad.scientist.com
07 Apr 2002 12:36:06 +0200


Yesterday, I compiled mono 0.10 against NGPT 1.2.0. It required some small
changes to the configure script, one mono c-file and one NGPT c-file.

1. The configure script doesn't support --with-gc=none (or
--without-gc), but I needed it because I do have libgc6, linked to
linuxthreads. I simply changed the *) case back to what is was before
linking with libgc6 worked, but adding an xnone) case would
be better of course.

2. The configure script doesn't add -lpthread to the LIBS. With
linuxthreads, this is not needed (because of -lrt?), but with
NGPT-pthreads it is. I fixed this by adding -lpthread in the makefiles
of all program directories, but of course it should be fixed in the
configure script.

3. icall.c uses environ. This gave me some problems, as glibc needs
__USE_GNU to export that variable. I changed the two occurrances to
__environ, but this also should be detected by the configure script
and __USE_GNU being defined accordingly.

4. NGPT 1.2.0 is the first NGPT with semaphore support. And it turns
out sem_destroy frees memory and then tries to reference it. I
notified IBM.

Also, the detection of pthread_mutex_timedwait works fine. NGPT
doesn't yet support it (but it looks trivial to implement, if I
understand the code correctly) and the configure script nicely falls
back to mono_mutex_timedwait.

Performance seems slightly lower, but I like the user-space threads.

Bye,
        Marijn