Questions tagged [cancellation]

Cancellation is paradigm that allows cooperatively canceling a running operation before it finishes.

Cancellation is paradigm that allows cooperatively canceling a running operation before it finishes.

In , cancellation is achieved using for signaling cancellation and a CancellationToken is used by the operation to check whether cancellation was requested.

712 questions
0
votes
1 answer

Android - check if instance of async task is running and cancel it before executing a new one

I have a gridview of bitmaps of very large number. To prevent out of memory error I only load a number of bitmaps and using onScrollListener I recycle the non nessecary bitmaps and create the ones that need to be shown. The loading bitmaps proccess…
Anonymous
  • 4,470
  • 3
  • 36
  • 67
0
votes
1 answer

How to cancel a wcf request silently without being noticed by the client

Is there a way to silent cancel processing a wcf request without being noticed by the wcf / web client? My web server is developed using WCF with WebHttpBinding and listen to the 80 port. What I mean is to let the client wait until timeout but the…
mind1n
  • 1,196
  • 3
  • 15
  • 34
0
votes
0 answers

Microsoft Workflow Foundation - Global Cancellation

I have a workflow that has multiple approval steps operationalized as WCF receives. Throughout the entire workflow process, it should be possible for the submitter of the process that initiated the workflow to cancel the process. My question is,…
0
votes
2 answers

C# Backgroundworker closing form

I am having an issue with a background worker. When i'm cancelling the backgroundworker, it closes the form too, i don't want it. I just want to stop the backgroundworker, and keep the form on the screen, and saying a message to the user like…
Gui O
  • 363
  • 4
  • 8
  • 22
0
votes
2 answers

iOS cancellable background task implementation

I need a class with a method which executes a background task. This method is called many times from different threads: each time this method is called, i need to stop the previous allocated background threads and start a new one, so the…
ʞᴉɯ
  • 5,376
  • 7
  • 52
  • 89
0
votes
1 answer

What is the concept behind writing a cancel operation in c++?

(Please note this is my first question so apologies on rule-breaking just let me know and I'll fix it) I'm attempting to write a cancel operation for a software download application. This application will first transfer the software to the device…
ToMan
  • 1
0
votes
4 answers

Stopping a single instance of a Thread

I have two instances of a thread which is running continuously . How can i stop the very first instance of the thread . Please find the code below :- public class Thread1 extends Thread { static volatile boolean bThreadStop = false ; public…
trp86
  • 414
  • 1
  • 7
  • 21
0
votes
1 answer

How to make program stop on any action, or cancel savefiledialog?

I have the following SaveFileDialog xmlDialog1 = new SaveFileDialog(); xmlDialog1.Filter = "XML File|*.xml"; xmlDialog1.Title = "Save a XML File"; xmlDialog1.FileName = "RhodesConfigCalc.xml"; xmlDialog1.ShowDialog(); //garante que não foi premido o…
César Amorim
  • 367
  • 3
  • 16
0
votes
1 answer

Why my AsyncTask is not being properly cancelled?

I made a filemanager that populates a listview through an AsyncTask populate(). If you have several hundred folders in a folder, it takes a couple of seconds to populate the listview adapter. However, you can click on a subfolder before the folder…
Luis A. Florit
  • 2,169
  • 1
  • 33
  • 58
0
votes
2 answers

How to interrupt a thread with future, want to perform some task by the interruption issued by future

I am new to future and multithreading in java. I have a simple problem which has turned out to be complex, I have a number of threads (all have open sessions in them) which are open infinitely. Whenever one thread throws a custom exception (a…
0
votes
1 answer

Cannot cancel a BackgroundWorker procss

I have a BackgroundWorker that includes a class ExcelOutput, used to output various data to a workbook, and I should mention straight away that bw.WorkerSupportsCancellation = True is set. At each stage of the output I'm checking for errors in…
David Gard
  • 11,225
  • 36
  • 115
  • 227
0
votes
1 answer

Sending a Cancellation Token in a Task

I have an async method that I want to be able to cancel that is currently called string html = await Html.WebClientRetryAsync(state); I have been trying to figure out the syntax to be able to call this method passing it a CancellationToken.…
Harrison
  • 3,843
  • 7
  • 22
  • 49
0
votes
1 answer

ThreadPool.RegisterWaitForSingleObject(CancellationToken.WaitHandle): will it ever finish?

I am implementing code from the accepted answer on this question. Now I'm having a problem looking like threads are being left open: the application never finishes. I think this may be caused by the bottom one of the two occurences of…
0
votes
0 answers

how to abort a long running objective c operation

I have a long running operation with a bunch of "_isCancelled" flags // long running code if (_isCancelled) return; // more code if (_isCancelled) return; // more code if (_isCancelled) return; // etc. but it would be much cleaner and…
Avba
  • 14,822
  • 20
  • 92
  • 192
0
votes
0 answers

Finally blocks run when the try block is cancelled

In my TFS2012 build workflow, I have a Parallel activity, and inside some of the branches I have try-finally activities. If one branch fails (say, compilation with CodeAnalysis finds CodeAnalysis errors), then the other branches are cancelled.…
Jonathan
  • 6,939
  • 4
  • 44
  • 61