[MLton-user] Problem with Timer.checkCPUTimer on Sparc

Stephen Weeks sweeks@sweeks.com
Mon, 3 Nov 2003 14:38:17 -0800


> The Basis spec doesn't make it clear to me whether system time spent
> during garbage collection should be allocated to usr or sys.  Right
> now, MLton gets the usr and sys values from a call to getrusage.  This
> has the effect of allocating system time spent during garbage
> collection to sys.  To allocate the system time to usr would require
> extra bookkeeping to keep track of the system time spent in gc and to
> subtract it off from sys and add it to usr.  That seems odd to me.
> I'll ask around to see what other SML implementors think.

The consensus is that system time spent during garbage collection
should be attributed to sys, not usr.  So MLton is OK there.  Also,
system time spent during garbage collection should *not* be counted by
Timer.checkGCTime.  This is not what MLton (20030716) does.  I had
interpreted the spec to mean that checkGCTime should sum the user and
system time spent in GC.  The spec will be clarified, and I have
checked in a change to the MLton CVS so that checkGCTime returns only
the user time spent while collecting.  With this latest change, your
intuition that usr >= gc will be correct.