how to create singleton which always running in separate thread?
<p>I would like to rephrase my previous question <a href="http://stackoverflow.com/questions/5783776/how-to-create-singleton-with-async-method">How to create Singleton with async method?</a></p>

<p>Imagine messaging application (like icq) - something that should be always connected to server and can post messages.</p>

<p>I need to implment class <code>Connection</code>. It should be singleton, because it contains "socket" inside and that socket should persist during entirely application lifetime.</p>

<p>Then I want to implement async method <code>Connection.postMessage</code></p>

<p>Because <code>postMessage</code> can take significant ammount of time:</p>

<ul>
<li><code>postMessage</code> should be async</li>
<li><code>postMessage</code> should queue messages if neccesary</li>
</ul>

<p>Note my application posts dozens messages per second, so it is not appropiate to create new Thread for each <code>postMessage</code> call.</p>

<p>I diffenetely need to create exactly one extra thread for messages posting but I don't know where and how.</p>

<p><strong>upd:</strong> good example <a href="http://msdn.microsoft.com/en-us/library/yy12yx1f(v=vs.80).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/yy12yx1f(v=vs.80).aspx</a></p>
