| Author |
How synchronize between Threads ?
|
Mark Guo
Ranch Hand
Joined: Nov 17, 2010
Posts: 56
|
|
|
How synchronize between Threads ?
|
 |
Jagdish Hatagale
Ranch Hand
Joined: Apr 07, 2010
Posts: 30
|
|
make the current executing object Synchronized
like Synchronized(this) and write the block of code in it.
|
 |
Jeff Verdegan
Bartender
Joined: Jan 03, 2004
Posts: 3141
|
|
Jagdish Hatagale wrote:make the current executing object Synchronized
like Synchronized(this) and write the block of code in it.
No. that's not it. First, you can't "make an object synchronized". Second writing a block of code in a synced object doesn't by itself accomplish syncing between threads.
|
 |
Jeff Verdegan
Bartender
Joined: Jan 03, 2004
Posts: 3141
|
|
Mark Guo wrote:How synchronize between Threads ?
Without a more specific question, the best answer I can give is to google for java concurrency tutorial or check out Bian Goetz's Java Concurrency in Practice or Doug Lea's Concurrent Programming in Java. Or perpahs to say, "Using the synchronized keyword," as the other respondent did, but that doesn't really answer your question, I imagine.
|
 |
 |
|
|
subject: How synchronize between Threads ?
|
|
|