Sleeping Processes


2005-09-06 08:41:10 PM
kylix0
Sorry for the cross-post, no responses in rtl for quite a while....
---------
I thought I'd share my experience here and see if anyone has a comment:
I've written a daemon which forks a new process for each request that comes
in via an Indy Server.
Each process connects to an Informix db via dbexpress. (forking used b/c the
dbx driver doesn't play well in threads)
Works well, except that 1 out of every 5,000 or so processes goes to
sleep -- More appropriately a coma, it will never wake up.
ps -p <pidnum>-o wchan
shows
WCHAN
rt_sigsuspend
(never, ever wakes up)
I discovered (to some surprise) that these processes go into coma after a
call to TStringlist's Values
i.e. somevar := Ts.Values['somevar'];
Writing an alternative method to using Tstringlists for this application has
brought the number of sleepers down significantly, but has not eliminated
them.
I'm speculating that this is b/c other classes also use Tstringlists for
their own use.
I'm not sure what to think about this. This class is very widely used and I
would think quite stable over the years--I really don't want to blame this
on Tstringlist,
yet the improvement can't be ignored.
One note: Since some of these forked processes are more important than
others, once forked, I do nice(-x ) some of them, but there seems to be no
corresponding pattern among the sleepers.
Has anyone had similar experiences ?
thanks,
-dh
------------
K3, problem exists across many revs of RedHat, right up to current