CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 2003
    Location
    Jodhpur -> Rajasthan -> INDIA
    Posts
    453

    Thread Synchronisation and communication

    Hello,

    I am developing a small graduate simulation project in which i have to simulate data link layer.

    In my project there will be two end: Sender and Reciever threads running.

    My sender thread will fetch object from a queue and then send it to the reciever thread with object id mentioned in object.

    When reciever thread recieves object send by Sender then it wil send acknowledgement for the object recieved and will mention that this is acknowledgement for object id which it has recieved.

    When sender recieves acknowledgement then it will then fetch another object from the queue and then send next object. and so on.

    -----------

    Case: If object sent by sender is lost/ not recieved to reciever then it will not send the ack.

    Case : Reciever recieves object but then it delays in sending ack,


    In any above case once the sender sends the object then it will wait for particular period of time to get the acknowledgement. if it doesnot gets the acknowledgement then it will resend the object.

    I am planning to use threading, but can you please guide me how to use this.

    Sandeep Arya
    Leave Your Mark Wherever You Go
    http://www.danasoft.com/sig/d0153030Sig.jpg

  2. #2
    Join Date
    Feb 2004
    Location
    USA - Florida
    Posts
    729

    Re: Thread Synchronisation and communication

    What you want is a producer/consumer model, the Java tutorial has a basic example of this: http://java.sun.com/docs/books/tutor...onization.html
    Hungarian notation, reinterpreted? http://www.joelonsoftware.com/articles/Wrong.html

  3. #3
    Join Date
    May 2003
    Location
    Jodhpur -> Rajasthan -> INDIA
    Posts
    453

    Re: Thread Synchronisation and communication

    Thanks for reply

    I want to know that how to implement this:

    I am having some frame object in queue. I just want to implement simulation of dropping of frame from the queue while sending from sender to reciever, usisng the concept of cubbyhole as in link provided by you.
    If sender doesnot get the acknowledgement for the frame then it will again send the frame back.

    2. I want to implement simulation of the timeout of acknowledgement which is sent by reciever when it gets the frame from the common class like cubbyhole.
    The schema at present is Sender takes tha packet from queue which is initialised in constructor and then assign the frame to commonclass. this common claas is the temporary reciepient of frame. then rciever get the frame from common class and then it send it send teh acknowledgement for the frame.
    If sender doesnot get the ack for fram in timeperiod then it will again send back the frame to the reciever thru commonclass.


    I want to know that how to easily simulate reciever acknowledgement sending timeout and dropping of frame sent by sender?


    Sandeep
    Leave Your Mark Wherever You Go
    http://www.danasoft.com/sig/d0153030Sig.jpg

  4. #4
    Join Date
    May 2003
    Location
    Jodhpur -> Rajasthan -> INDIA
    Posts
    453

    Re: Thread Synchronisation and communication

    any suggestions?

    SANDEEP
    Leave Your Mark Wherever You Go
    http://www.danasoft.com/sig/d0153030Sig.jpg

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured