|
From: | Jan Djärv |
Subject: | Re: emacs-unicode-2 bootstrap on FreeBSD (temacs coredump) |
Date: | Wed, 01 Aug 2007 11:20:26 +0200 |
User-agent: | Thunderbird 2.0.0.5 (X11/20070719) |
YAMAMOTO Mitsuharu skrev:
A comment in src/lib/libc/stdlib/malloc.c (FreeBSD Current) says: /* * Mutexes based on spinlocks. We can't use normal pthread mutexes, because * they require malloc()ed memory. */ So it seems to be impossible to make src/gmalloc.c thread-safe only using pthread mutexes.
Totally thread safe is impossible, but for Emacs we don't need that. It should be OK to initialize gmalloc in a non-thread safe way because it is done in main (or possibly before) before any threads are created.
I'm not sure if spinlocks are open to user applications, but anyway it would be simpler to define SYSTEM_MALLOC when HAVE_GTK_AND_PTHREAD && !DOUG_LEA_MALLOC, and abandon emacs_blocked_malloc etc. on such platforms. I don't care if my changes made to src/gmalloc.c for thread-safety is reverted.
That is always a possibility. I'll look into both. Jan D.
[Prev in Thread] | Current Thread | [Next in Thread] |