This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes creating a deadlock. 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 » Beginning Java
Reply Bookmark "creating a deadlock." Watch "creating a deadlock." New topic
Author

creating a deadlock.

mitti sharma
Greenhorn

Joined: Sep 27, 2007
Posts: 5
I have to create a dead lock in the following code that has two worker threads that carry out the addition.
my assignment says it can be done by adding one line of code.
i was able to do it by changing the order of arguments(In w2 i changed it from s,a to a,s)

Worker w1 = new Worker (s,a);
Worker w2 = new Worker (a,s);

but as i said i have to add code line not alter the orignal one,so
can someone suggest me if there are other ways to put this in deadlock?

-----------------------------------------------------
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: creating a deadlock.
 
Similar Threads
Doubt in one question
Multithreading: Sun Web Learning Center
Threads access to private instance variables
Array increment
Find shortest string with all the words in any order