From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alex Harsanyi Newsgroups: gmane.emacs.devel Subject: Re: "resource temporarily unavailable" errors on windows 7 Date: Thu, 15 Mar 2012 08:02:42 +0800 Message-ID: References: <83aa3lybos.fsf@gnu.org> <83vcm9w3th.fsf@gnu.org> <83obs0wb0p.fsf@gnu.org> <83d38fvzsc.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1331769799 29140 80.91.229.3 (15 Mar 2012 00:03:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Mar 2012 00:03:19 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 15 01:03:16 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1S7y9x-0006EN-I2 for ged-emacs-devel@m.gmane.org; Thu, 15 Mar 2012 01:03:13 +0100 Original-Received: from localhost ([::1]:45271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7y9w-0007u7-Si for ged-emacs-devel@m.gmane.org; Wed, 14 Mar 2012 20:03:12 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:33478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7y9s-0007s0-H0 for emacs-devel@gnu.org; Wed, 14 Mar 2012 20:03:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S7y9Y-0001TL-JT for emacs-devel@gnu.org; Wed, 14 Mar 2012 20:03:08 -0400 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:46367) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S7y9V-0001SR-6n; Wed, 14 Mar 2012 20:02:45 -0400 Original-Received: by werj55 with SMTP id j55so2961631wer.0 for ; Wed, 14 Mar 2012 17:02:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=K9fb0LNZnYtheNkGJ766oo6ie5jYQJX8LL5zDGwbn1c=; b=u7fYsdBFZe/V/5EHq8KBZdjz9li7j4Cferzid6CS1Xzxotb1AOWlBh4Wnwgy366AmR OgtpqLNi4sdF5/J99KWp21JY285CcAiSX2n5+Zt54WvOtQ/RBEQYckS+WZfu4Wz87T95 oNYSpEhHhc9uyInlTY/rryyfDvwxTWDca9WqfwGGIkVufKGRl0KzK7et50zWUbfFYfH8 2zmazeidnTN0l5LLZ2bVaQEKvVXIkfcbB+9ppcgf9vRTZRh5dpHdJQwpy1wAz5f48u+7 KNNuXOyBUNbODpQDl4FlTT2Wlph28wbV2G7uygiC5IBqYr0rLA7cEAALOiOq+KU3F0uX ACFg== Original-Received: by 10.180.100.228 with SMTP id fb4mr10800592wib.1.1331769762250; Wed, 14 Mar 2012 17:02:42 -0700 (PDT) Original-Received: by 10.223.64.212 with HTTP; Wed, 14 Mar 2012 17:02:42 -0700 (PDT) In-Reply-To: <83d38fvzsc.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:149062 Archived-At: 2012/3/15 Eli Zaretskii : >> Date: Wed, 14 Mar 2012 13:34:42 +0800 >> From: Alex Harsanyi >> Cc: emacs-devel@gnu.org >> >> 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. =A0 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. =A0I than tried a few values for the dwStackSize >> parameter and the smallest stack reservation I could obtain was 64K, >> Here is the call: >> >> =A0 =A0cp->thrd =3D 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.