View RSS Feed

Thread

Thread communication

Rate this Entry
by , 01-08-2012 at 12:18 PM (1238 Views)
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

Submit "Thread communication" to Facebook Submit "Thread communication" to Digg Submit "Thread communication" to del.icio.us Submit "Thread communication" to StumbleUpon Submit "Thread communication" to Google

Categories
Tutorial

Comments