aspose file tools
The moose likes Threads and Synchronization and the fly likes interaction between callable(threads) Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Threads and Synchronization
Reply Bookmark "interaction between callable(threads)" Watch "interaction between callable(threads)" New topic
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
    
  19

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)
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: interaction between callable(threads)
 
Similar Threads
Thread question
PDF of Head First Servlets & JSP
Technical interview q & a
Writing Code for Multi Core CPU
Timer Threads in JDK1.2