delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/10/30/19:49:12

From: newsham AT lava DOT net (Tim Newsham)
Subject: more questions
30 Oct 1997 19:49:12 -0800 :
Message-ID: <m0xR5tN-0010wpC.cygnus.gnu-win32@malasada.lava.net>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

Hi,
   A couple more questions:

- pinfo is locked for the duration of the fork() operation.  Does this
  lock the current process slot or the entire process table?
  If the entire table, couldnt the exclusion interval be shortened
  to just grabbing the new slot?  Seems like some parallelism is
  being wasted here.

- In fork the fork helper the stack is copied as:
    rc = copy (child->hProcess, &x, u->initial_sp, 3);
  which assumes (I assume :) that "x" is at the bottom of
  the stack.  This is not documented anywhere that I can
  see in the src (DANGER!) and a quick look at the src
  doesn't convince me that it is at the bottom of the stack.
  Is it?  If not, couldn't this cause some obscure bugs?
  Maybe the address should be taken from a local in a
  called frame:
     get_stacktop() { int x; return &x; }
  or maybe the address should be rounded down to an even
  page?

- In the fork helper the child (after longjmp'ing from crt0)
  sets the process mask.  Isn't this copied over from the parent?
  If its not, isn't there a race condition here between when
  the child is created (or the process table entry is created)
  and when this line is reached?

                                      Tim N.

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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