info-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Timestamp race avoidance in do_update()


From: Larry Jones
Subject: Re: Timestamp race avoidance in do_update()
Date: Wed, 14 Feb 2001 16:22:24 -0500 (EST)

Laine Stump writes [quoting me]:
> > 
> > Unfortunately, usleep() isn't portable.
> 
> Okay, then how about nanosleep()?

nanosleep() is even less portable.  (It's part of the POSIX real-time
extensions.  I think usleep() is part of the base POSIX standard;
sleep() definitely is and it's been in Unix "forever" so it's much more
widely implemented.)

> Aside from the basic extra duty of keeping track of multiple files at
> once rather than cycling through a list, each commit for each file has
> a different log comment, so multiple commits *can't* be done with a
> single invocation of cvs. (I take that back - I suppose I could save
> all log comments, then go back and change them later with a long
> string of "cvs admin -m<rev>:<message> <file>" commands, but that
> makes the script even more complex and memory intensive, and we must
> remember that I'm a lazy programmer, who would rather change one sleep
> to nanosleep() than to write a ton of confusing perl ;-)

You could always have the script talk directly to a CVS server using the
client/server protocol -- since the server no longer sleeps, that would
avoid the problem.  You could also run the CVS commands in the
background so you don't have to wait for the sleep before continuing
(although you may end up waiting on your own locks in that case).

-Larry Jones

There's never enough time to do all the nothing you want. -- Calvin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]