This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: When I start a process in bash - which pid is correct - Windows Task Manager or ps -ef


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]