Timekeeping [Was: Re: cvs commit: src/usr.bin/vmstat vmstat.c src/usr.bin/w w.c]

Poul-Henning Kamp phk at phk.freebsd.dk
Fri Oct 21 12:53:29 PDT 2005


In message <01DFB595-5279-4D3A-BEDA-5F0285E9519B at xcllnt.net>, Marcel Moolenaar 
writes:

>> I think we need the definition to consider if (process- ?)state is
>> retained while the system is unconcious or not.
>
>I'm not sure. I think that might be what makes the definition
>complex.

Actually I don't think it does, it simplifies it.

If a process survives across the "unconcious" period, then it follows
that CLOCK_MONOTONIC cannot be reset to zero in relation to the
unconcious period.


But we are only just scratching the surface here, there are tons of
ambiguities we need to resolve, for instance:

	select(...., {3m0s})
	suspend
	[ 2 minutes pass ]
	resume

When does select time out ?

    One minute after the resume ?

    Three minutes after the resume ?

    Right after the resume with a special errno ?


Some code should obviously know about the suspend/resume event,
dhclient, wep, wpa, bgpd, sshd, just to mention a few

But the majority of processes couldn't care less.


I wish POSIX gang had taken a look at the HP Integral (I think it
came out in 1985 ?) and thought "Gee, we better think about how
portable unix should work in the future..."

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the cvs-src mailing list