title: Asynchronous delegates vs Threads
body: <p>Replacing Threads (not ThreadPool Thread) with Asynchronous Delegates (Callbacks).</p>
  
  <p>My Scenario: Spawn a Thread/del.beginInvoke() per Client.</p>
  
  <p>According to me,</p>
  
  <p>Reasons</p>
  
  <ol>
  <li>need for Notification via Callback / Call delegate again in Callback</li>
  <li>Avoid Thread Overhead, (delegates use Threadpool thread)</li>
  <li>Passing Arguments (Avoid Casting to object)  and need return value from the method. </li>
  </ol>
  
  <p>Correct me if above reasons are wrong. </p>
  
  <ol>
  <li>Is any other Reasons?    </li>
  <li>What scenario i exactly need to do some stuff with Asynchronous Delegates that 
  threads can't?<br>
  3.Performance ?</li>
  </ol>
  
  <p>Example</p>
  
  <pre><code>    public delegate void SendCallbackType();
  
      SendCallbackType senderdel= new SendCallbackType(SendData);
  
      public void StartSend() // This method Could be Called more than 700 times (Thread per Client)
      {
          senderdel.BeginInvoke(SendCallback,null);
                     // (or)
          Thread t = new Thread(new ThreadStart(ThreadSend));
          t.IsBackground = true;
          t.Start();
      }
  
    //Async Delegate
      void SendData()
      {
           string data = QueData.DeQueue();
           RaiseOnData(data); // Raise to event.
      }
      void SendCallback(IAsyncResult ar)
      {
          senderdel.BeginInvoke(SendCallback, null);
      }
  
   //Thread
    void ThreadSend()
    {
        while (true)
        {
           string data = QueData.DeQueue();
           RaiseOnData(data); // Raise to event.
        }
     }
  </code></pre>
  
  <p>From the above which option would be the best. Performance ? </p>