title: What is the concept behind writing a cancel operation in c++?
body: <p>(Please note this is my first question so apologies on rule-breaking just let me know and I'll fix it)</p>
  
  <p>I'm attempting to write a cancel operation for a software download application. This application will first transfer the software to the device and then install the software on it. (These are givens I'm not allowed to change). </p>
  
  <p>What should the cancel operation do? When a user presses 'cancel', the application should stop transferring/installing the software immediately.</p>
  
  <p>Question: Since I've never written a "cancel" function, I'm wondering what are the types of things to consider when writing the code, and what are the common bugs I should expect and how to deal with them? </p>
  
  <p>Couldn't find anything in google so if you have some links that would be good reads I'd really appreciate it since I'm not looking for answers I'm just looking for guidelines/macro/concept help</p>