Boost logo

Boost Users :

From: Matthias Kaeppler (nospam_at_[hidden])
Date: 2005-06-20 03:37:22


I am currently working on a filemanager for the Linux operating system,
and I'm currently thinking about how to implement copying operations,
such that
1. The GUI won't be blocked when operating on files
2. File operations can be cancelled at any time

I thought about using Boost.Thread to run all the copy operations (which
will be performed by Boost.Filesystem). However, I'm not quite sure how
to handle this situation:

Say copying a huge file, maybe 1GB+, is in progress. The progress will
be displayed in a dialog window, as usual.
Now the user decides that he wants to stop the copy operation, and
clicks a cancel button.

Now what do I do?
The only means to terminate a thread that I know of is:
1. Killsignal it (I don't think boost supports it, since it's probably
highly platform dependent)
2. Check for a terminate flag once in a while and return from the method
once it is set.

But how am I supposed to do the latter? The copy function doesn't return
until it's finished right? So I can't check for a condition, because the
copy-thread itself is blocked until it's done.

I'm completely stuck here, help greatly appreciated.


Matthias Kaeppler

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at