aspose file tools*
The moose likes Threads and Synchronization and the fly likes Need info regarding threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Need info regarding threads" Watch "Need info regarding threads" New topic
Author

Need info regarding threads

Yogesh Gandhi
Ranch Hand

Joined: Dec 05, 2008
Posts: 207



Output:
A = 0
Sleeping for 0 ms.
A = 1
Sleeping for 0 ms.
A = 2
Sleeping for 0 ms.
B = 0
Sleeping for 0 ms.
A = 3
Sleeping for 0 ms.
B = 1
Sleeping for 0 ms.
A = 4
Sleeping for 0 ms.
B = 2
Sleeping for 0 ms.
A = 5
B = 3
Sleeping for 0 ms.
B = 4
Sleeping for 0 ms.
B = 5


What I am wondering is, why is the value of delay coming as zero.
I need clarity about which object is being used, when a run method is invoked.

Regards
Yogesh
Yogesh Gandhi
Ranch Hand

Joined: Dec 05, 2008
Posts: 207
I got the mistake,

It should be

this.delay = delay and I was doing it otherwise.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need info regarding threads