lundi 21 décembre 2015

what is the effect of a lock on a static object in a web applicaiton on iis 8

we are having some issues with nhibernate in an MVC asp.net web app, One of our first theories was that since session is not thread safe, that might be causing our issue.

we are using structure map, and our session wrapper is instantiated as a "hybrid" which is supposed to solve threading issues by having 1 session per request.

to test this theory, we put a static object lockObject in our session wrapper, and then put locks around any call that modifies (but not retrieves) anything on the session object.

But I'm uncertain as the effect this will have under high load. What we want is no non synchronous access to a give instance of session, will it instead synchronize across all instances, even if memory is not shared?

Is there a better way to achieve our goals?

Thanks

Aucun commentaire:

Enregistrer un commentaire