[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Pretest?
From: |
YAMAMOTO Mitsuharu |
Subject: |
Re: Pretest? |
Date: |
Thu, 15 Mar 2007 21:08:10 +0900 (JST) |
>>>>> On Thu, 15 Mar 2007 12:04:33 +0100, Jan Djärv <address@hidden> said:
>> I suspect src/gmalloc.c, which does not provide thread-safe malloc
>> (correct me if I'm wrong), is used while HAVE_GTK_AND_PTHREAD is
>> defined.
> If src/gmalloc.c is used, then the hooks in alloc.c are used, so
> they should be thread safe.
No, alloc_mutex only protects the variables __malloc_hook etc., but
not for the heap itself. Consider the following scenario:
1) The main thread calls malloc.
2) It then calls emacs_blocked_malloc via __malloc_hook.
3) __malloc_hook is set to old_malloc_hook in emacs_blocked_malloc.
4) Now the main thread is in execution of the original malloc.
5) Another thread also calls malloc.
6) The thread also executes the original malloc because
__malloc_hook == old_malloc_hook.
YAMAMOTO Mitsuharu
address@hidden
- Re: Pretest?, (continued)
- Re: Pretest?, Eli Zaretskii, 2007/03/03
- Re: Pretest?, Giorgos Keramidas, 2007/03/04
- Re: Pretest?, Chong Yidong, 2007/03/04
- Re: Pretest?, Giorgos Keramidas, 2007/03/04
- Re: Pretest?, David Kastrup, 2007/03/04
- Re: Pretest?, Giorgos Keramidas, 2007/03/04
- Re: Pretest?, Jan Djärv, 2007/03/05
- Re: Pretest?, YAMAMOTO Mitsuharu, 2007/03/15
- Re: Pretest?, Jan Djärv, 2007/03/15
- Re: Pretest?,
YAMAMOTO Mitsuharu <=
- Re: Pretest?, Jan Djärv, 2007/03/16
- Re: Pretest?, Jan Djärv, 2007/03/19
- Re: Pretest?, YAMAMOTO Mitsuharu, 2007/03/19
- Re: Pretest?, Giorgos Keramidas, 2007/03/19
- Re: Pretest?, Jan Djärv, 2007/03/20
- Re: Pretest?, Jan Djärv, 2007/03/27
- Re: Pretest?, YAMAMOTO Mitsuharu, 2007/03/28
- Re: Pretest?, Jan Djärv, 2007/03/05
Re: Pretest?, Piet van Oostrum, 2007/03/06