Re: Thread cancelation problem

Denis Corbin <[email protected]> Sat, 04 Dec 2004 01:13:32 +0100
Newsgroups gmane.comp.sysutils.backup.dar.libdar
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Johnathan Burchill wrote:
| Hi Denis,

Hello Johnathan,

|
| Sometimes thread cancellation does not work. For example, in KDar if I
test
| a relatively small archive, say a backup of the kdar source directory,
the
| thread cancellation request is ignored by libdar. Sometimes this happens
| with diff and isolate too.
|
| Also, if I do a dry-run (empty) restoration, the cancellation request is
| ignored.
|
| The issue seems lie with the null_file class. I see in going from version
| 1.8 to 1.9 in CVS that you no longer derive null_file from
| thread_cancellation, and you've removed the check_self_cancellation from
| the read and write methods. So if an archive is small enough to be
| completely in memory, then perhaps the thread cancellation check points
| will never be reached.
|
| When I went back to version 1.8 of null_file.hpp libdar responded very
| quickly to all cancellation requests.
|
| Was the change in null_file.hpp intentional? I couldn't find any notes on
| the change in the CVS log.

Yes it was intentional. The reason is that whatever the operation you
do, you alsways read data from a file. There is thus no need to have the
null file doing a second check_self_cancellation as the "fichier" class
used to read each file to backup, or used to read the archive to
test/list/compare/extract (even in dry-run execution) should do the
check regulary when data flow.

If an archive is small enough to be done in memory it must be less than
10 KB. More data will make at least two read/write operations thus at
least one thread cancellation check. In another hand, if the archive is
small, and execution short, thread cancellation may not be very useful.

By the way, I have noted a typo error (cancellation with one 'l') in all
that concern the class for thread cancellation. If you don't mind I will
not fix this mistake now?

The CVS log for null_file.hpp revision 1.9 is uncomplete you are right,
only four actions on five are listed (I usually try to keep it correct
an complete).

|
| I recommend reverting to the version 1.8 behaviour of null_file.hpp.
|

Well, I don't see why the fact to remove the thread cancelation from
null_file avoids thread cancelation to operate even in dry-run mode. But
I have quite not much time actually to spend with dar :-( so I will just
revert to 1.8 as you suggested. Still plane to have pre-release starting
very soon.


| Cheers,
| JB


Cheers,
Denis.

P.S.: CVS is now up to date with this change.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBsQErpC5CI8gYGlIRAsLmAJ467aR+Wo+miRV88IK61XptZ0as5ACdHJSm
ujAOZFzGVF32adLipTAuMHw=
=7upH
-----END PGP SIGNATURE-----



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/