"Jan D." <[EMAIL PROTECTED]> writes:

>>
>> This sounds like normally only the main thread should ever be touching
>> interrupt_input_blocked, unless we have a bug.  Correct?  So we need
>> not think about how to synchronize accesses to the variable, but
>> rather make sure that no thread except the main thread will ever run
>> code touching it.  Correct?
>>
>> A use of BLOCK_INPUT or UNBLOCK_INPUT outside of the main thread is a
>> bug.  Correct?
>
> Yes times three.

I have got the debugging working.  Clearly xmalloc is called in a
separate thread (its BLOCK/UNBLOCK calls which are placed just round
malloc are interspersed with that of other routines), and its
deallocation interferes with the deallocation from the main thread.
So we should probably add an xassert into BLOCK_INPUT and
UNBLOCK_INPUT that complains when we are in anything but the main
thread.  And then see whether we can get rid of all the resulting
aborts in a sane manner.

If we don't do this, I am afraid that we will be plagued with
occasional unreproduceable aborts and/or problems.

I also doubt that it is a good idea to have mallocs in parallel
threads at the same time.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

Reply via email to