This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

wait() and notify() methods ragarding threads.

dolly bhawsar
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to know how should i implement, if i have two threads waiting on a bunch of code to be complete.

just for an simple example: if i have write a function to calculate sum of few integers and after performing this sum i m displaying that amount.
finally i want that one thread perform this sum() and another print it,,so i want that while executing the sum() through one thread another would wait for it's completion.

please someone tell me the code for implementing above, so that i can clearly understand the basic idea of wait and notify. i m confused in terms of when to wait, for which object i have to use wait(), and when and for which thread i have to use notify().

Dolly Bhawsar
sushil grover
Posts: 12
I agree. Here's the link:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic