I was reading Walkthrough: Creating an Asynchronous HTTP Handler and noticed they pass the HttpContext
from the handler thread and use it in a WaitCallback
which runs on a background thread. It makes calls like _context.Response.Write()
. Am I correct in assuming that this doesn't violate the fact that HttpContext is not thread safe because the handler thread will not be using it after the async work has started?
Also, Using an HTTPContext across threads has some good information about HttpContext and threads. Is all of HttpContext not thread safe, or just items like Response
? Can multiple background threads access the Items
property, if only in read mode?