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

    thread synchronisation- Producer keeps on producing but consumer not always consumes

    Hello

    Well i am implementing G back N ARQ protocol simulation. How to implement tis?

    My sender thread will be keep on adding to my common handler class (a class being assesed by both sender and reciever) while my reciever thread check the handler class queue member and check if the sie is more than it will try to grab from there.

    Point is both want to assess the same common class so how to maintain synchronisation in between them?

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

  2. #2
    Join Date
    Apr 2005
    Location
    Norway
    Posts
    3,934

    Re: thread synchronisation- Producer keeps on producing but consumer not always consumes

    For an example of a synchronized event queue you may take a look at this:
    http://www.codeguru.com/forum/showth...83#post1136383

    - petter

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

    Re: thread synchronisation- Producer keeps on producing but consumer not always consumes

    The Java tutorial has an explicit example of this: http://java.sun.com/docs/books/tutor...onization.html
    Hungarian notation, reinterpreted? http://www.joelonsoftware.com/articles/Wrong.html

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