aspose file tools
The moose likes Threads and Synchronization and the fly likes Sharing variable between two threads. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes 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: 36
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Sharing variable between two threads.
 
Similar Threads
how to split a text file
Code Optimizatoin
File Operations Program Problem
Parsing a text file to an arraylist
Reading the last (or last but 1) line in a text file