Thanks for the fast reply. I do not UUIDs to survive anything. In fact they should only be unique as long as a file is open. I am working on a thin, thread-safe C++ wrapper around HDF5. Locking the individual objects and make their interfaces thread-safe is one thing. But there is another problem with HDF5: consider two concurrent threads opening the same object in the file. Though the types returned would be thread-safe, the fact that both threads act on the same object in the file would lead to inconsistencies. To circumvent this problem I plan to establish a central registry where all objects are retrieved from. Each object is opened only once and appended to the registry using a unique identifier as a key (that's why I need a unique identifier for each object). Clearly these UUIDs must be only unique during the lifetime of a file object. The code itself only works with references to the objects stored in the registry. Thus, at least I think so, locking the objects should make sense again and two threads can safely work on the same object.
regards Eugen On Fri, 2012-08-17 at 08:41 -0500, Gerd Heber wrote: > Eugen, how are you? Yes, you can concoct something that is unique in the > file scope using addresses, but I'd be hesitant to go down that path. > I'd invest in a few UUIDs (call it whatever you want) attributes and not > look back. They survive repacks and other machinations. > True, for existing read-only files, you'd have to maintain a mapping on the > side. > Addresses are not your friends, if you know what I mean... > > Best, G. > > -----Original Message----- > From: [email protected] [mailto:[email protected]] > On Behalf Of Wintersberger, Eugen > Sent: Friday, August 17, 2012 8:28 AM > To: [email protected] > Subject: [Hdf-forum] Unique object identifier > > Hi folks > I need to get a unique ID for each object in an HDF5 file (as the path to > an object is not unique). As far as I know there is nothing like this in > HDF5 out of the box. However, I have seen that one can retrieve the address > of an object within the file. Can this address be used as a unique > identifier? > > regards > Eugen > -- > --------------------------------------- > | DI. Dr. Eugen Wintersberger | > | | > | FS-EC | > | HASYLAB at DESY | > | Notkestr. 85 | > | D-22607 Hamburg | > | Germany | > | | > | E-Mail: [email protected] | > | Telefon: +49-40-8998-1917 | > --------------------------------------- > _______________________________________________ > Hdf-forum is for HDF software users discussion. > [email protected] > http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org > > > > _______________________________________________ > Hdf-forum is for HDF software users discussion. > [email protected] > http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org
