From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 102b08,6266f9f777efcf2d X-Google-Attributes: gid102b08,public X-Google-Thread: 1164f8,6266f9f777efcf2d X-Google-Attributes: gid1164f8,public X-Google-Thread: 114b0c,6266f9f777efcf2d X-Google-Attributes: gid114b0c,public X-Google-Thread: f4871,6266f9f777efcf2d X-Google-Attributes: gidf4871,public X-Google-ArrivalTime: 1994-01-28 04:41:33 PST Xref: gmd.de comp.sys.sun.apps:6818 comp.sys.hp:28836 comp.parallel.pvm:1335 comp.sys.dec:13089 Path: gmd.de!xlink.net!howland.reston.ans.net!agate!apple.com!ntg!blackknight.eng.3do.COM!not-for-mail From: limes@freeside.eng.3do.COM (Greg Limes) Newsgroups: comp.sys.sun.apps,comp.sys.hp,comp.parallel.pvm,comp.sys.dec Subject: Re: Accessing Real Time Clock in workstations (HPs, Suns, Dec Alphas) Date: 26 Jan 1994 20:07:52 -0800 Organization: New Technologies Group Message-ID: <2i7emo$g8l@freeside.eng.3do.COM> References: <1994Jan26.005700.2572@icaen.uiowa.edu> NNTP-Posting-Host: freeside.eng.3do.com barts@cyber.Eng.Sun.COM (Bart Smaalders) writes: >Gettimeoday(2) is implemented as a fast trap since Solaris 2.2. As a result, >this call takes about 2->3 microseconds on a SS10 (slightly more on an SS2). >It returns answers accurate to the resolution of the hardware clock (1 microsecond >on 4[cmd] platforms). In article <1994Jan26.005700.2572@icaen.uiowa.edu>, Doug Siebert wrote: >It seems to me it would make a GREAT deal of sense to map things like the >hardware clock into a process' address space read-only. > ... > Is there a reason >why this isn't done? Note the "2-3 microseconds". That's a lot better than the cost to get into and back from a system call, last I heard :-) :-) The problem is that the hardware clock doesn't give the complete time; on most suns, you get something indicating the time since the latest timer tick. Of course, if the kernel kept a data page that was full of interesting data (like "what time it was a moment ago") then the library *could* do a gettimeofday without ever passing into system land. But ... try to generalize that for everything Solaris runs on, and things start getting sticky. I'd imagine that HP and DEC have similar issues. for comp.sys.sun.apps folks ... SunOS 4.1.[23] Sun-4M easter egg: I left the 64-bit high resolution timers mapped readable from userland, at 0xFD020000 (you can verify the address by checking for the symbol "_utimers" in /vmunix). BTW, using the above is of course "not supported" and will not work in Solaris 2 ... nor will it work on anything other than a Sun-4M or compatible hardware. -- Greg Limes [limes@netcom.com] Not in any way affiliated with Sun Microsystems