On Sat, Sep 09, 2000 at 01:53:57PM -0700, Zack Weinberg wrote:
> On Sat, Sep 09, 2000 at 01:44:32PM -0700, Manoj Kasichainula wrote:
> > On Sat, Sep 09, 2000 at 09:39:15AM -0700, Zack Weinberg wrote:
> > > Also, TIME probably needs to be more precise than seconds since epoch,
> > > because several transactions might arrive in one second. Adding the
> > > microsecond count from gettimeofday() should be good enough.
> > Why not just use an incremented counter (plus pid)? This avoids a
> > system call per transaction, and is just simpler.
> I got the impression that each transaction was handled by a separate
> process. A counter wouldn't work unless it was stored on the
> filesystem or in shared memory - either of which involves more system
> calls to get at. And if gettimeofday(2) isn't dirt cheap, your OS has
> serious problems.
The counter doesn't have to be unique across all threads/processes. The
format would still be PID.COUNTER. Therefore, it can reside in the PID's
state and you're all set.
Greg Stein, http://www.lyra.org/
Received on Sat Oct 21 14:36:08 2006