| Author |
interaction between callable(threads)
|
sanjey asok
Ranch Hand
Joined: Jul 11, 2009
Posts: 36
|
|
I have two threads and both want to share some information without any synchronization,
1)is it possible?
2) if possible,please explain How?
sorry to give less details
|
 |
Wouter Oet
Saloon Keeper
Joined: Oct 25, 2008
Posts: 2700
|
|
|
The java tutorial has a part on concurrency (here) which you should read. It covers all the aspects about threading and synchronization.
|
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 16810
|
|
sanjey asok wrote:I have two threads and both want to share some information without any synchronization,
1)is it possible?
2) if possible,please explain How?
sorry to give less details
First, I would recommend getting very comfortable with using threads and synchronization first. Once you get really really comfortable, then you can start learning how to do optimistic locking algorithms.
Lock-less synchronization can get really hairy -- not for the faint of heart.... but... if you want to play around with it, take a look at the java util concurrent atomic classes.
Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
 |
|
|
subject: interaction between callable(threads)
|
|
|