Re: Fwd: I would like to cancel archive creation
Denis Corbin <[email protected]>
| Newsgroups | gmane.comp.sysutils.backup.dar.general |
|---|---|
| Organization | none |
| Message-ID | <[email protected]> |
Johnathan Burchill wrote: > On June 19, 2004 09:59 am, Johnathan Burchill wrote: > >>Hi Denis, Hello Johnathan, >> >>I received this from a kdar user who asks whether it is possible to >>cancel a libdar operation. My first attempt will be to add the "dry-run" >>feature to the creation process. However, this is not a "quick" test of >>the backup, I think it takes a time comparable to the actual backup. Is >>this right? I think this is faster, but I have not made real comparison ;-) >> >>As far as interrupting the creation process, now that libdar is >>thread-safe, would there be a way to send it a "kill" signal, to get it >>to stop what it is doing? A couple of people have asked for this >>feature. does a SIGTERM handler would help ? There is a mutex to release, file descriptors to close, and memory to release. I suspect Linux closes file descriptors let openned by the thread, but it cannot obviously be done the same for mutex (which are shared by all threads). For other system I don't know what's the behavior about file descriptors. > > > QT has a method for terminating a thread, but this warning comes with the > documentation: > > Warning: This function is dangerous, and its use is discouraged. The thread > can be terminate at any point in its code path. Threads can be terminated > while modifying data. There is no chance for the thread to cleanup after > itself, unlock any held mutexes, etc. In short, use this function only if > absolutely necessary. (from http://doc.trolltech.com/3.3/qthread.html) > > For the command line dar, a <Ctrl>-C will interrupt the libdar operation. > I'm guessing that the terminate method is the equivalent for the QT GUI > version. In dar-2.1.3, the library is not thread safe, so I only run one > operation at a time, and killing the operation shouldn't be problematic as > there are no locked mutexes. This should be like hitting <Ctrl>-C. > But the new threadsafe library may have issues with this technique. yes. > > Any comments? What standard mechanism over signal handlers can preempt a thread and let it do some arbitrary action ? I don't like polling. :-/ > > Cheers, > JB Cheers, Denis. ------------------------------------------------------- This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND