c# - Does a single web request to IIS stay on a single thread? -
i want write logging http module stores list of log events single request in thread local storage while request executes. on end_request want write events persistent storage.
question is, 1 request match 1 thread? i.e. can assume anywhere in code can add items ienumerable , @ end of request.
no. asp.net can potentially switch threads while processing request. known thread-agility.
there points can/will this. can't remember off top of head - searching reference now...
but short answer no: can't rely on same thread-local storage being accessible entire duration of request.
Comments
Post a Comment