title: Threading, communication between two threads c#
body: <p>I'm wondering what is the best way to implement communication between two threads. I have one thread that generates random number(class Sender) and now I want to have another thread(class Receiver) that 'll receive generated random number.
  This is Sender:</p>
  
  <pre><code>public  class Sender
  {
      public int GenerateNumber(){
  
  
          //some code
          return randomNumber;
      }
  }
  </code></pre>
  
  <p>Afcourse in Main function I'll start those threads:</p>
  
  <pre><code>static void Main(string[] args){
  
       Sender _sender=new Sender();
       Thread thread1=new Thread(new ThreadStart(_sender.GenerateNumber));
  
  }
  </code></pre>
  
  <p>I appreciate your help </p>