Subj : Re: Solaris real-time thread capabilities To : comp.unix.solaris,comp.programming.threads From : Eric Sosman Date : Tue Sep 06 2005 06:53 pm capnwhit@yahoo.com wrote: > Hello Logan, My Solaris Internals book (c) 2001, mentions on page 47 > that the average latency for gethrtime() is 320 nanoseconds... If this > were true it would make me very happy :-) The problem is when I get a > latency one million (1,000,000) times the published value... that's > when I start wondering if I am doing something wrong... You can only make gethrtime() calls at a rate of three per second? I share the wonderment in your final sentence, along with your suspicion that something unaccounted-for is going on. ("Unaccounted-for" sounds so much more tactful than "wrong," don't you think?) How are you measuring the rate? Please supply a code sample. FWIW, I just ran a brief test on my desktop system, a venerable Ultra-10 running Solaris 9 on an ancient UltraSPARC-II processor at a whopping 360 MHz. I ran this simple loop: for (i = 0; i < 101; ++i) when[i] = gethrtime(); .... and then post-analyzed the 100 sample-to-sample intervals. The slowest observed was 692 ns, the fastest was 291 ns, the average was 296 ns, and the standard deviation was 40 ns. That's reasonably close to the 320 ns figure cited in the book, but nothing at all like your 320,000,000 ns ... Disclaimer: I'm writing about Sun products and I work for Sun, but I do not speak for Sun. -- Eric.Sosman@sun.com .