How do I asynchronously run things?
Look into the HTTP Parallel Request &amp; Threading Library. The Imageinfo Cache module uses it to generate imagecache presets when a file is uploaded on a node form, and does a final check on node save; all in the background. The other module to look into using is Background Process, it does similar thing as HTTPRL and the 2 modules are actually looking to merge together (http://drupal.org/node/1357652). 

An example of how to flush caches in the background is in the httprl readme