How can we achieve communication between two threads?