Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Can threads commnicate with one another?  RSS feed

 
Avin Sinanan
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I know that threads allow events or actions to take place in parallel.
But if a method or some set of actions are being excuted in seperat threads can one one thread send another value to another thread.
That is,threads can be parallel but can they also be dependent on one another?
Can someone breif me on this please. Thanks a million.
yours respectfully Avin Sinanan
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Avin,
Absolutely. Look at the javadocs on PipedInputStream and PipedOutputStream.

Hope this helps,
Michael Morris
SCJP2
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again Avin,
I just looked at the topic line But still absolutely, if a thread object has a reference to an object on a different thread. The thing to remember is, only one thread is running at a time.
Hope this helps
Michael Morris
SCJP2
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!