Newsgroups: comp.os.minix
Subject: Re: ????? What is SHADOW_Q ?????
References: <8tcgsl$1mb$1@nnrp1.deja.com>
Organization: Rochester Institute of Technology, Rochester, NY
From: aje9383@osfmail.isc.rit.edu (Andrew Erickson)
NNTP-Posting-Host: grace.isc.rit.edu
X-Original-NNTP-Posting-Host: grace.isc.rit.edu
Message-ID: <39fa0137@news.isc.rit.edu>
Date: 27 Oct 2000 18:27:03 -0500
X-Trace: 27 Oct 2000 18:27:03 -0500, grace.isc.rit.edu
Lines: 32
XPident: aje9383
X-Original-NNTP-Posting-Host: 129.21.4.100
XPident: Unknown
Path: news.adfa.edu.au!clarion.carno.net.au!news0.optus.net.au!news1.optus.net.au!optus!intgwpad.nntp.telstra.net!news-hog.berkeley.edu!ucberkeley!newsswitch.lcs.mit.edu!bloom-beacon.mit.edu!news.kodak.com!news-nysernet-16.sprintlink.net!news.sprintlink.net!news.isc.rit.edu!aje9383
Xref: news.adfa.edu.au comp.os.minix:35993

In article <8tcgsl$1mb$1@nnrp1.deja.com>,  <denopas@my-deja.com> wrote:
>Hi friends,
>
>While I was examining proc.c to learn how minix process scheduling
>works,I saw a queue named SHADOW_Q but I couldn't find which process
>would SHADOW_Q hold?Can you help me please.....

On most versions of minix, nothing ever ends up in SHADOW_Q (and, I think,
no actual queue structures are allocated for it).  On versions for machines
with no memory management hardware of any sort--i.e. the 68000 versions--
this holds shadowed process images.

Shadows are created on these machines to support fork() system calls.  Since
there is no memory management hardware, the kernel must copy the child and
the parent back and forth to the same physical address; the shadow holds
the non-running process image.  (That's actually a little bit of a
simplification; things get quite tricky to follow when, say, a child
also fork()s, or a parent fork()s twice, or such.  I'm not really sure
if Minix handles those sorts of things in a reasonably efficient manner
or not.)

Yes, fork()s on the 68K versions of Minix are *very* expensive, especially
if they don't soon either exec() or wait().  This is the only situation I
know of where the 8086 segmented architecture is nicer to work with than
the flat 68K memory space.  (There are, of course, MMUs availiable for the
newer 68K family members, often built into the processor chip.)

I think there's a brief discussion of shadowing in OS:D&I somewhere, but
it's been awhile since I thumbed through the book.

-- 
Andrew Erickson
