title: Static variable across multiple requests
body: <p>In order to improve speed of chat application, I am remembering last message id in static variable (actually, Dictionary).</p>
  
  <p>Howeever, it seems that every thread has own copy, because users do not get updated on production (single server environment).</p>
  
  <pre><code>private static Dictionary&lt;long, MemoryChatRoom&gt; _chatRooms = new Dictionary&lt;long, MemoryChatRoom&gt;();
  </code></pre>
  
  <p>No treadstaticattribute used...</p>
  
  <p>What is fast way to share few ints across all application processes?</p>
  
  <p><strong>update</strong></p>
  
  <p>I know that web must be stateless. However, for every rule there is an exception. Currently all data stroed in ms sql, and in this particular case some piece of shared memory wil increase performance dramatically and allow to avoid sql requests for nothing.</p>
  
  <p>I did not used static for years, so I even missed moment when it started to be multiple instances in same application.</p>
  
  <p>So, question is what is simplest way to share memory objects between processes? For now, my workaround is remoting, but there is a lot of extra code and I am not 100% sure in stability of this approach.</p>