Results 1 to 8 of 8
  1. #1
    rameshraj is offline Member
    Join Date
    Dec 2007
    Posts
    42
    Rep Power
    0

    Thumbs up Thread communications!

    Hi everybody,I want to send some message or data to a thread.I have got the thread id.How can I achieve this?
    In general I want to have thread communication.Can anyone help me?

  2. #2
    sanjeevtarar's Avatar
    sanjeevtarar is offline Senior Member
    Join Date
    Apr 2008
    Location
    Jaipur(India)
    Posts
    318
    Rep Power
    7

    Default

    Can you explain some more..?
    sanjeev,संजीव

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    What you really want to do? Communicating on a thread? May be in a specific time interval? Explain it more pal.

  4. #4
    danielstoner's Avatar
    danielstoner is offline Senior Member
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    191
    Rep Power
    7

    Default

    A thread is an execution path in your program. You cannot send data to a thread. You can make the thread access some data, check for data, wait for data and so on.
    Daniel @ [www.littletutorials.com]
    Language is froth on the surface of thought

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  6. #6
    rameshraj is offline Member
    Join Date
    Dec 2007
    Posts
    42
    Rep Power
    0

    Thumbs up

    A thread listening on some dataStreams and I want such thread to send data via the dataStreams used.I have the thread's id also.Is is possible?

  7. #7
    danielstoner's Avatar
    danielstoner is offline Senior Member
    Join Date
    Apr 2008
    Location
    Canada
    Posts
    191
    Rep Power
    7

    Default

    You can make a thread wait on a "data stream" as long as the "data stream" read API is written in such a way that will make the thread that is trying to read to wait until data is available and then notifies it. An example is the sockets API. So yes, it is possible. But again you don't send data to a thread, you notify a thread waiting for your data that the data has become available.
    Daniel @ [www.littletutorials.com]
    Language is froth on the surface of thought

  8. #8
    rameshraj is offline Member
    Join Date
    Dec 2007
    Posts
    42
    Rep Power
    0

Similar Threads

  1. data from the main/GUI thread to another runnin thread...
    By cornercuttin in forum Threads and Synchronization
    Replies: 2
    Last Post: 04-23-2008, 10:30 PM
  2. How to get thread name
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-09-2008, 06:40 PM
  3. Replies: 0
    Last Post: 01-28-2008, 07:02 AM
  4. using Thread
    By one198 in forum New To Java
    Replies: 1
    Last Post: 11-21-2007, 08:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •