[lug] Fwd: Simple counter?
bgiles at coyotesong.com
Fri May 24 10:09:56 MDT 2013
Too bad there isn't a /dev/counter.
On Fri, May 24, 2013 at 9:44 AM, Michael J. Hammel <
mjhammel at graphics-muse.org> wrote:
> On Fri, 2013-05-24 at 09:39 -0600, Jeffrey S. Haemer wrote:
> > I want something that returns me sequential integers. I ask it, I get
> > a 1. Three more times? I get 2,3,4. You ask it, you get 5, I ask
> > again, I get 6, and so on. If we both call it at the same time, we
> > should *not* get the same number.
> It's been awhile since I've used it, but I think MySQL has a field that
> is auto-incrementing. Not sure about being able to read it without it
> updating, though. Something tells me that there may be configurable
> options for such a field since its a fairly common need.
> The nice thing I remember about this is that all accesses to it are
> serialized, so we can both read it and the first one it gets the first
> increment and the next one in gets the next increment.
> Michael J. Hammel <mjhammel at graphics-muse.org>
> Web Page: http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the LUG