wood burning stoves 2.0*
The moose likes Threads and Synchronization and the fly likes Sharing variable between two threads. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Reply locked New topic
Author

Sharing variable between two threads.

Joseph Cho
Ranch Hand

Joined: Feb 19, 2012
Posts: 42
I'm trying to have one thread keep track of the time while the main thread does the work.. For some reason the thread is not getting the updated variable, how do I get this to work? I tried using a static variable but it's not working..

Here is the code:

Rakesh K. Cherukuri
Ranch Hand

Joined: Jun 01, 2010
Posts: 47

Duplicate of http://www.coderanch.com/t/597439/threads/java/Sharing-variable-between-two-threads

The other one already has responses


Warm Regards,
Rakesh
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sharing variable between two threads.
 
Similar Threads
Reading the last (or last but 1) line in a text file
how to split a text file
File Operations Program Problem
Parsing a text file to an arraylist
Code Optimizatoin