Skip to contentSkip to conversation

high-res-timers start code.

DISCUSSION Robert H. de Vries (by way of Robert H. de Vries <[email protected]>) 1 participant 1 message Apr 23, 2001

lore
Share & tools
lore
#0 lore raw
Quoted 15 lines · George Anzinger
Quoted 5 lines · Robert H. de Vries
Quoted 1 line · you

By the way, is the user land stuff the same for all "arch"s?

Not if you plan to handle the CPU cycle counter in user space. That is at least what I would propose.

Just got interesting, lets let the world look in.

What did you have in mind here? I suspect that on some archs the cycle counter is not available to user code. I know that on parisc it is optionally available (kernel can set a bit to make it available), but by it self it is only good for intervals. You need to peg some value to a CLOCK to use it to get timeofday, for instance.

Quoted 5 lines

On the other hand, if there is an area of memory that both users and system can read but only system can write, one might put the soft clock there. This would allow gettimeofday (with the cycle counter) to work without a system call. To the best of my knowledge the system does not have such an area as yet.

It obviously is an architecture dependent thing. I know of two archtictures which have such a counter: your standard pentium and up and the SGI systems from at least the Indy and up. I wouldn't be surprised if most CPU's have such a counter. If you look at some of the architecture specific code for the gettimeofday code you would quickly find out which architectures have such a feature. I have some code for the intel in my user space library. For the SGI I also have some code, but only for IRIX. I guess for Linux we could do similar code.

Robert

Signature · 2 lines
Robert de Vries
[email protected]