freebsd_amp_hwpstate/usr.sbin
Bill Paul faf215c7ad This commit changes the YPPROC_ALL procecdure so that it handles requests
_without_ using fork().

The problem with YPPROC_ALL is that it transmits an entire map through
a TCP pipe as the result of a single RPC call. First of all, this requires
certain hackery in the XDR filter. Second, if the map being sent is
large, the server can end up spending lots of time in the XDR filter
sending to just the one client, while requests for other clients will
go unanswered.

My original solution for this was to fork() the request into a child
process which terminates after the map has been transmitted (or the
transfer is interrupted due to an error). This leaves the parent free
to handle other requests. But this solution is kind of lame: fork()
is relatively expensive, and we have to keep a cap on the number of
child processes to keep from swamping the system.

What we do now is grab control of the service transport handle and XDR
handle from the RPC library and send the records one at a time ourselves
instead of letting the RPC library do it. We send a record, then go
back to the svc_run() loop and select() on the socket. If select() says
we can still write data, we send the next record. Then we call
svc_getreqset() and handle other RPCs and loop around again. This way,
we can handle other RPCs between records.

We manage multiple YPPROC_ALL requests using a circular queue. When a
request is done, we dequeue it and destroy the handle. We also tag
each request with a ttl which is decremented whevever we run the queue
and a handle isn't serviced. This lets us nuke requests that have sat
idle for too long (if we didn't do this, we might run out of socket
descriptors.)

Now all I have to do is come up with an async resolver, and ypserv
won't need to fork() at all. :)

Note: these changes should not go into 2.2 unless they get a very
throrough shakedown before the final cutoff date.
1996-11-30 22:38:44 +00:00
..
IPXrouted
ac
accton
adduser Don't show on the screen just securely entered password 1996-11-27 22:04:55 +00:00
amd
apm
apmconf
arp
bad144
bootparamd
cdcontrol
chown
chroot
config
cron
crunch
ctm
dev_mkdb
diskpart
edquota
fdcontrol
fdformat
fdwrite
inetd
iostat
kbdcontrol
kbdmap
kernbb
keyadmin
kgmon
kvm_mkdb
lpr
lptcontrol
manctl
mixer
mkdosfs
mount_portalfs
mountd
moused
mrouted
mtree
named
named.reload
named.restart
ncrcontrol
ndc
newsyslog
nfsd
nologin
nslookup
pccard
pciconf
pcvt
pkg_install
portmap
ppp
pppd
pppstats
pstat
pwd_mkdb
qcamcontrol
quot
quotaon
rarpd
repquota
rmt
rndcontrol
rpc.lockd
rpc.statd
rpc.yppasswdd
rpc.ypxfrd
rtprio
rwhod
sa
sade Change boolean nature of "router" variable since it's not a boolean 1996-11-29 23:52:20 +00:00
sendmail
sgsc
sicontrol
sliplogin
slstat
spkrtest
spray
stallion
sup
sysctl
sysinstall Change boolean nature of "router" variable since it's not a boolean 1996-11-29 23:52:20 +00:00
syslogd
tcpdump
timed
traceroute
trpt
tzsetup
vidcontrol
vipw
vnconfig
watch
wormcontrol
xntpd
xten
yp_mkdb
ypbind
yppoll
yppush
ypserv This commit changes the YPPROC_ALL procecdure so that it handles requests 1996-11-30 22:38:44 +00:00
ypset
zic
Makefile
Makefile.inc