View RSS Feed

Thread

Threads in Java. Java multithreading examples.

  1. Thread communication

    by , 01-08-2012 at 12:18 PM
    Following methods are used to perform communication between threads.

    • Wait()
    • Notify()
    • notifyAll()

    In the following code, count is a shared variable between different threads. It’s a consumer producer process in which consumer waits in consume() method and waits for producer to perform its action.

    Name:  62.JPG
Views: 494
Size:  26.1 KB

    Thread communication
    Categories
    Tutorial