CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Jun 2009
    Posts
    16

    Attempting better multithreading design

    In my program, I'm currently using two large datastructures (a tree and a linked list) which are heavily dependant on each other. The tree's nodes contain pointers to the linked list's nodes.
    Both datastructures have to update each other whenever a change occurs in either of them.
    (jpeg diagram attached)

    The multithreading:
    There are some object instances M1, M2, M3 & M4 which are part of some thread instances. Any of these modules from any of these threads might decide to make a change to any of the nodes of the datastructures.

    My issue is that when one thread is busy making changes to any node of the database, all the other threads have to wait, because if they try to change any part of the database, everything will get messed up because both databases are dependant on each other.

    To avoid such thread waiting, which section of the architecture/design would you recommend that I change? and how?

    (jpeg diagram of the flow is attached)
    Attached Images Attached Images

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