Re: Empty option for testing archives

Denis Corbin <[email protected]> Sun, 27 May 2007 18:51:17 +0200
Newsgroups gmane.comp.sysutils.backup.dar.libdar
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Johnathan Burchill wrote:
> Hi Denis,

Hello Johnathan,

> 
>> the archive pointed to by 'a' is passed to both threads thus the same
>> variable is modified by both threads at the same time. Morevoer, the
>> archive::op_test method() is not a constant method, but OK, I am not
>> sure that all const methods of the API can be used without mutex by
>> different threads on the same object at the same time. I will double
>> check this right now.
>>
>> To solve your problem I would create two archive objects (yes, memory
>> will suffer) or avoid using concurrent thread here.
> 
> Is it possible to get a copy constructor for archive::archive?

it should be possible, however it will duplicate the catalogue inside
the archive, this double the memory requirements. However, as the
archive contains references to the slicing/compression/encryption layers
on disk theses could not be copied without raising concurrent I/O access
to the archive layout on disk.

> Better still, 
> would it be possible to have an "archive archive::isolate()" function to 
> obtain a copy of an isolated archive without writing it to disk?

Here the problem is that an archive object holds references to the file
layout (slicing/compression/encryption...) which exist even withing
isolated catalogue. Well, I must double check but it should be possible
to have this operation on a pure memory object (file layout pointing to
a 'null' generic_file object, class that already exist).

> That would 
> give an opportunity to run empty methods on a small copy of the archive in a 
> concurrent thread.

the fact that the archive is isolated will not make the copy smaller:
The archive object is all tha in memory part of an archive. There is no
significative difference of size between an archive object and its
isolated archive object counterpart.

Maybe it would be interesting to start from the need to see if there is
some other ways (simpler or more intersting --- from the libdar inside
point of view) to address this need.

> 
>> Regards,
>> Denis.
> 
> Cheers,
> JB
> 

Regards,
Denis.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGWbcEpC5CI8gYGlIRAmolAJ44xloLXxDiajVDumcyI/kaE17w9QCeNgjW
fDJM/XtMGaYd9lxDxWHG0w8=
=HhgY
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/