delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/10/10/18:38:32

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
Message-ID: <470D544E.D0EC40BC@dessent.net>
Date: Wed, 10 Oct 2007 15:38:06 -0700
From: Brian Dessent <brian AT dessent DOT net>
X-Mailer: Mozilla 4.79 [en] (Windows NT 5.0; U)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: When I start a process in bash - which pid is correct - Windows Task Manager or ps -ef
References: <VA DOT 000016c2 DOT 0192a98b AT thesoftwaresource DOT com>
X-IsSubscribed: yes
Reply-To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Brian Keener wrote:

> Problem is if I go to Windows Task Manager it shows the two vims as
> 6128 for the 4712 one and 4524 for the 5292 one.
> 
> Now in this particular case I don't have a problem with which pid is
> correct because it's just vim but the application I have been trying to
> gather info on does the same thing.
> 
> Should we be seeing or is there a way to see what the other processes
> are that account for the missing pids.  Windows Task manager does not
> have an entry for pid 4712 or for 5292 so where did these numbers come
> from - some interim process I imagine I just don't see how it all ties
> together.
> 
> Any additional info greatly appreciated.  I've included a cygcheck
> ouytput but is this output from cygcheck normal:

Every process has a Cygwin PID and a Windows PID.  Only Cygwin tools can
grok Cygwin PIDs, obviously.  There are no "missing" PIDs, it's just
that native tools like taskman have no idea what a Cygwin PID is since
it's a made-up number.  It depends on the context as to which you use to
refer to a process -- if you're using a Cygwin app, you use the Cygwin
PID.

(The reason this PID renaming is necessary is to emulate exec() which
has the semantics of replacing a process with a new one while keeping
the same PID, handles, CWD, and so on.  Windows does not have any such
concept so it has to be emulated by spawning the new process and then
referring to it by the old PID of the parent that has now terminated,
even though this child has a new PID assigned by the OS.)

Brian

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019