Re: Using packed structs to gain cheap SMP primatives

2000-04-05 Thread Peter Jeremy
On Fri, Mar 31, 2000 at 12:50:51AM +1000, Alfred Perlstein wrote: >What I'm calling for is a vote if we'll rely on this type of behavior >(32 bit stores being atomic with respect to readers) or not, or >perhaps to rely on it but mark it somehow so people can "fix it" >if the need arises later by u

Re: Using packed structs to gain cheap SMP primatives

2000-03-30 Thread Assar Westerlund
Alfred Perlstein <[EMAIL PROTECTED]> writes: > I'm aware of this, the problem is that tz may move in either > direction. Why not just ignore the timezone argument? That hasn't been relevant for a long time. The timezone information is kept in user-space. >From gettimeofday(2): Note: time

Re: Using packed structs to gain cheap SMP primatives

2000-03-29 Thread Poul-Henning Kamp
In message <[EMAIL PROTECTED]>, Mike Smith writes: >> 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 cal

Re: Using packed structs to gain cheap SMP primatives

2000-03-29 Thread Mike Smith
> 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

Re: Using packed structs to gain cheap SMP primatives

2000-03-29 Thread Alfred Perlstein
* Jonathan Lemon <[EMAIL PROTECTED]> [000329 21:52] wrote: > In article [EMAIL PROTECTED]> you >write: > > > >I'm aware of this, the problem is that tz may move in either > >direction. Hence my question about using sizes that are machine > >atomic for read/write. :) > > > >I've got several book

Re: Using packed structs to gain cheap SMP primatives

2000-03-29 Thread Jonathan Lemon
In article [EMAIL PROTECTED]> you write: >* Allen Pulsifer <[EMAIL PROTECTED]> [000329 21:05] wrote: >> Here's another alternative for reading structures like time >> that always change monotonically: read the values in >> "MSB" to "LSB" order, then go back and check in reverse >> order that noth

Re: Using packed structs to gain cheap SMP primatives

2000-03-29 Thread Alfred Perlstein
* Allen Pulsifer <[EMAIL PROTECTED]> [000329 21:05] wrote: > Here's another alternative for reading structures like time > that always change monotonically: read the values in > "MSB" to "LSB" order, then go back and check in reverse > order that nothing has changed. For example, to read a > stru

RE: Using packed structs to gain cheap SMP primatives

2000-03-29 Thread Allen Pulsifer
, March 29, 2000 11:36 PM > To: Alfred Perlstein; Mike Smith > Cc: Matthew Dillon; [EMAIL PROTECTED] > Subject: RE: Using packed structs to gain cheap SMP primatives > > > Here's another alternative for reading structures like time > that always change monotonically: re

RE: Using packed structs to gain cheap SMP primatives

2000-03-29 Thread Allen Pulsifer
Here's another alternative for reading structures like time that always change monotonically: read the values in "MSB" to "LSB" order, then go back and check in reverse order that nothing has changed. For example, to read a structure containing hours, minutes, seconds: for (;;) { h = timep