> Op 23 december 2016 om 21:14 schreef Kent Borg <kentborg@xxxxxxxx>: > > > Hello, a newbie here! > > Doing some playing with Python and librados, and it is mostly easy to > use, but I am confused about atomic operations. The documentation isn't > clear to me, and Google isn't giving me obvious answers either... > > I would like to do some locking. The data structures I am playing with > in RADOS should work great if I don't accidentally fire up more than one > instance of myself. So I would like to drop an attribute on a central > object saying it's mine, all mine--but only if another copy of myself > hasn't done so already. > > Is there some sample code to show me the safe way to do this? > You might want to use a RADOS watcher in this case? Your application would be registered as a watcher and while it is running you can check if there are other watchers on a object before you proceed. I don't have a code example right now, but you might want to look in that direction. Wido > Thanks, > > -kb, the Kent who is reluctant to just play around with locking to see > what works...because it might look like it is working, yet still have a > race susceptibility. > > _______________________________________________ > ceph-users mailing list > ceph-users@xxxxxxxxxxxxxx > http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com _______________________________________________ ceph-users mailing list ceph-users@xxxxxxxxxxxxxx http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com