In nlc.lists.freebsd-current you wrote:
> At 12:09 PM 2/1/99 +1100, Gregory Bond wrote:
>>> "You are not supposed to understand this."

"You are not expected to understand this."

>>It was (IIRC) the process switching magic at the heart of fork() in V7 (and
>>earlier, I assume).

> If I remember right, it referred to the non-local goto juju where if the
> forked processed was swapped out, the label jumped was changed to yet
> another place.  Unfortunately, my annotated V6 listing is not accessible
> right now...

It's inside the swtch() function call. Just having a quick look now.

Inside expand(), where core is allocated for a process, if no core is
available the process is swapped out with a call to xswap(), then
switched out with a call to swtch(). When core becomes available and
the process image is read in from swap, the process will be selected
by swtch() to become runnable. However with the current context, swtch()
would return and the tail end of the expand() function would execute.
So inside expand() a call is made to save the stack state so that when
swtch() restores this state, the return skips over the expand() function
entirely.

Cheers.
--            +------------------------------------------------------------+
        .     | John Saunders  - mailto:j...@nlc.net.au            (EMail) |
    ,--_|\    |                - http://www.nlc.net.au/              (WWW) |
   /  Oz  \   |                - 02-9489-4932 or 041-822-3814      (Phone) |
   \_,--\_/   | NHJ NORTHLINK COMMUNICATIONS - Supplying a professional,   |
         v    | and above all friendly, internet connection service.       |
              +------------------------------------------------------------+

To Unsubscribe: send mail to majord...@freebsd.org
with "unsubscribe freebsd-current" in the body of the message

Reply via email to