root@topaz.RUTGERS.EDU (Charles Root) (03/08/86)
As of System V release 2 version 2 there is a facility that is very close to job control. I happen to prefer real Berkeley job control, but certainly many of the jibes at ATT for doing nothing in this area are undeserved. The facility is shl (shell layers). It has been claimed that this is useful mostly for terminals such as the BLT. I only have conventional terminals, so I will just describe what it does there. shl is a sort of top level. You run shells (typically) under its control. These subsidiary shells are called "layers". To get from one of the layers back to shl, you just type ^Z (sound familiar?). To continue a layer, you just type its name (not very different from %name in the csh to continue a job). The one thing I don't like about it is that you must explicitly create a new layer using the create command, rather than just ^Zing one process and starting another one, or starting several processing with &. But it isn't *that* bad. I am not sure how all of this is implemented. At first I was afraid that the top level put the layers on the equivalent of pty's, and had to process every characater. But this does not seem to be true. A devices called an "sxt" is used to coordinate the layers. Each layer gets its own sxt (actually its own subchannel on the same sxt, but it shows up as a separate device). But it appears that the currently active sxt is somehow connected directly to the controlling tty, and thus its I/O does not go through the top-level process. It is not yet clear to me whether programs can interact with this system the way they can with job control. E.g. under 4.2, Emacs has its own ^Z command that does some cleaning up and then triggers job control to suspend the process. When you resume it, Emacs knows what is going on, and redraws the screen. I don't know whether this is possible under shell layers. Again, let me be clear that I would have preferred to see ATT adopt some redesign of Berkeley's job control. But fairness requires that you know what they actually have done.