X-Recipient: archive-cygwin@delorie.com
X-Spam-Check-By: sourceware.org
Date: Tue, 6 Dec 2011 11:38:34 +0100
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin@cygwin.com
Subject: Re: Machine very sluggish while compiling
Message-ID: <20111206103834.GL12518@calimero.vinschen.de>
Reply-To: cygwin@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
References: <4ECEE88E.5050307@cs.utoronto.ca> <20111125154751.GP28395@trikaliotis.net> <4EDB2761.6040508@cs.utoronto.ca> <20111204100639.GA9849@calimero.vinschen.de> <4EDD44E0.7070701@cornell.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <4EDD44E0.7070701@cornell.edu>
User-Agent: Mutt/1.5.21 (2010-09-15)
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

On Dec  5 17:25, Ken Brown wrote:
> On 12/4/2011 5:06 AM, Corinna Vinschen wrote:
> >Anyway, stoppping the PCA service and setting its start mode to "Manual"
> >does the trick for me.
> 
> It does the trick for me too.  For a long time I've been unable to
> build emacs using cygport's default for parallel make (-j5 because I
> have 4 cores).  When I did this, I would either have the computer
> freeze (and I would have to shut it down with the power button) or
> else I would get a BSOD.
> 
> Since stopping PCA, the problem seems to be gone.

In the meantime I found another way how to avoid this problem.

Here's an excerpt from the MSDN man page of AssignProcessToJobObject:

  If the process is being monitored by the Program Compatibility
  Assistant (PCA), it is placed into a compatibility job. Therefore, the
  process must be created using CREATE_BREAKAWAY_FROM_JOB before it can
  be placed in another job. Alternatively, you can embed an application
  manifest that specifies a User Account Control (UAC) level in your
  application and PCA will not add the process to the compatibility job.

So, what I did was to change Cygwin locally to add the
CREATE_BREAKAWAY_FROM_JOB flag to the CreateProcess call when execing a
process.  With this change, I had no problems with PCA anymore.

I also tried to use an "asInvoker" side-by-side manifest for mintty, but
I had no luck with it.  PCA still wasted memory and CPU.

So I'm wondering if we should simply add the CREATE_BREAKAWAY_FROM_JOB
flag to our CreateProcess calls and be done with it.  As far as I can
see, and from what MSDN claims, there should be no problem doing that.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

