emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "resource temporarily unavailable" errors on windows 7


From: Alex Harsanyi
Subject: Re: "resource temporarily unavailable" errors on windows 7
Date: Thu, 15 Mar 2012 08:02:42 +0800

2012/3/15 Eli Zaretskii <address@hidden>:
>> Date: Wed, 14 Mar 2012 13:34:42 +0800
>> From: Alex Harsanyi <address@hidden>
>> Cc: address@hidden
>>
>> I also read the MSDN documentation for CreateThread and it looks like
>> the dwStackSize parameter represents the commit size unless the
>> STACK_SIZE_PARAM_IS_A_RESERVATION flag is passed to CreateThread.   I
>> tried adding this flag, but it was not recognized by mingw so I
>> replaced it with the value (0x00010000).
>>
>> When I recompiled, the resulting emacs would reserve 1Mb of stack for
>> each new thread.  I than tried a few values for the dwStackSize
>> parameter and the smallest stack reservation I could obtain was 64K,
>> Here is the call:
>>
>>    cp->thrd = CreateThread (NULL, 64 * 1024, reader_thread, cp,
>> 0x00010000, &id);
>
> And does this smaller stack reservation improve the situation, if you
> return the initial memory request in allocate_heap to its original
> value.
>

Yes it does.  I'm using a build with allocate_heap starting at 2GB
(the original value) and this updated CreateThread call as my working
Emacs.   I will continue to use it and I will report if I see any more
errors.

Also, the strange dwStackSize  interpretation by CreateThread was
tested on Windows 7 32 bit only.   I'm not sure how this behaves on
other windows versions.

Perhaps at minimum, the mingw build should be updated to use 1Mb stack
reservation in the program header?

Alex.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]