Have a look at this article by Fritz Onion: Use Threads and Build Asynchronous Handlers in Your Server-Side Web Code. It's quite long, but your requirement is not too trivial.
Also K. Scott Allen posted a somewhat shorter article about this very issue: Working With HttpContext.Current