> Yesterday I was looking at how Linux handles the gettimeofday stuff
> without locking thier sys_tz variable, well it seems they don't care
> or I'm missing something important.
> 
> They just don't lock it, not that settimeofday will be called all that
> often but it leaves me wondering what we can do about this, effectively
> we can pack our tz (sys_tz in Linux) into a 32bit value which should
> afford us read/write atomicity on every platform I'm aware of.
> 
> In fact this can be quite effective for certain types of data structures,
> even though our 'struct timezone' is two ints we can pack it into two
> uint16 and pack a private structure, then copy it to a stack and expand
> it into the user's address space.

It would be cheaper just to lock the bloody thing, although you can't 
pack all the significance of a timeval into 16 bits anyway (in a fashion 
that's going to make many people happy).

-- 
\\ Give a man a fish, and you feed him for a day. \\  Mike Smith
\\ Tell him he should learn how to fish himself,  \\  [EMAIL PROTECTED]
\\ and he'll hate you for a lifetime.             \\  [EMAIL PROTECTED]




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to