|
I'm using a BackgroundWorker to perform a long computation (only one such computation at a time).
The user has the possibility of cancelling the worker (calling worker.CancelAsync).
In the worker.DoWork method I periodically check for the cancel pending...
Started by Stecy on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Also - if the DoWork method has finished then....
If the user can also cancel via a key press then you'll also need to disable that too.
Could do is disable the "Cancel" button when the user clicks it and also on exit from the DoWork method.
|
|
Currently i am working on a desktop application which consists mathematical analysiss.I am using qt for GUI and project written in c++. When user starts an analysis, i open a worker thread and start a progress bar.Everything is ok up to now, problem starts...
Started by Qubeuc on
, 9 posts
by 9 people.
Answer Snippets (Read the full thread at stackoverflow):
1) as was mentioned, put a 'cancel' flag in the operation, and have that operation poll the cancel flag at regular (close) intervals, probably at least as often as you update your progress bar.
There's a few approaches here.
Operation.
|
|
Can you cancel a Boost Thread as you would a pthread?
I'm writing a simple watchdog to terminate worker threads if they crash and there doesn't seem to be a way to simply cancel a thread in the Boost Thread library.
Started by Justin Scheiner on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
They don't support cancelling out of the box (as pointed out by Duck ), however depending.
They don't support cancel, which is a good thing since it can cause all manner of subtle problems things up.
|
Ask your Facebook Friends
|
Is it possible to cancel out of a long running process in VB6.0 without using DoEvents?
For example:
for i = 1 to someVeryHighNumber ' Do some work here ' ... if cancel then exit for end if next Sub btnCancel_Click() cancel = true End Sub
I assume I need...
Started by Stuart Helwig on
, 9 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
You can make it all.
In the Timer event handler you can check for "cancel" and stop early as required.
|
|
Apparently Christo Kourtzidis is cancelling his visit to Texas
Started by teasip84 on
, 18 posts
by 9 people.
Answer Snippets (Read the full thread at rivals):
I think we lost 4 (?) this year: Irby, Howard... .
Surprisingly, we're down to 4 TEs now: Barrett Matthews, DJ Grant, Darius Terrell and MJ McFarland and Matthews and Grant will both be seniors this year .
Well then I guess it's Vincent Hobbs' for the taking .
|
Proper way of cancelling accept and closing a Python processing/multiprocessing Listener connection.
Hi!
(I'm using the pyprocessing module in this example, but replacing processing with multiprocessing should probably work if you run python 2.6 or use the multiprocessing backport )
I currently have a program that listens to a unix socket (using a processing...
Started by Henrik Gustafsson on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
EDIT: Another way to implement this might be to use the Connection Queues , since they seem to support... .
Probably not ideal, but you can release the block by sending the socket some data from the signal handler or the thread that is terminating the process .
|
|
Very occasionally when making a http request, I am waiting for an age for a response that never comes. What is the recommended way to cancel this request after a reasonable period of time?
Started by wodemoneke on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
If....
You can also use an asynchronous HTTP client such as twisted.web.client , but that's probably not necessary .
The original urllib has no such convenient feature.
The timeout parameter to urllib2.urlopen , or httplib.
Set the HTTP request timeout.
|
|
Hello,
C# 2008
I am using the code below to login to a softphone. However, the login progess is a long process as there are many things that have to be initialized and checks to be made, I have only put a few on here, as it would make the code to long...
Started by robUK on
, 7 posts
by 7 people.
Answer Snippets (Read the full thread at stackoverflow):
Cancel property to true! Thread.ResetAbort(); //Prevents ThreadAbortException propagation.
|
|
If I'm connecting to an ssh server and I noticed I made a mistake in the username, how do I cancel the session when the server is prompting me for password?
The only way I know is to press ctrl-c to kill the ssh process, is there a better way?
I don't...
Started by hasen j on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at serverfault):
I don't have any log examples to hand, but what it does is take the username ... .
If you feel masochistic and launch the sshd daemon on the server side in userspace with debug logging turned on, you'll see it .
I'm pretty sure there isn't a way to do that .
|
|
I have implemented a token system which assigns a fixed number of tokens. Each token on assignment starts up a Timer which expires after a few number of minutes and clears that token slot for reuse. If the user validates the token before the timer expires...
Started by whatnick on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
After the line where you try and cancel the timer, you application should suffice....
With the future, you can cancel it, or check the result.
A better way.
If you timer is not null, you should be able to call cancel() from any thread.
|