Thread: how to identify dependency between statements automatically

  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    8

    Thumbs down how to identify dependency between statements automatically

    suppose if there are two statements in a for loop
    Code:
    for(i=0;i<n;i++)
    {
    
    A(I) = B ( I ) + C(I)
    B(I + 2) = A(I - 1) + C(I -1)
    A(I + 1) = B(2*I + 3) + 1
    }
    suppose if we run these for I values like 1,2,3
    
    FOR I value 1
    S(2) :A(2) = B(2) + C(2)
    T(2) :B(4) = A(1) + C(1)
    U(2) :A(3) = B(7) + 1
    FOR I value 2
    S(3) :A(3) = B(3) + C(3)
    T(3) :B(5) = A(2) + C(2)
    U(3) :A(4) = B(9) + 1
    here in B(5) has to be wait for A(2).in sequential programming is concerned it is ok.suppose if it is parallel program it will create ambiguity.

    how to identify this types of loop automatically in a program.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Skipping If Statements?
    By CBecker5000 in forum C Programming
    Replies: 1
    Last Post: 11-08-2009, 04:05 PM
  2. Unknown memory leak with linked lists...
    By RaDeuX in forum C Programming
    Replies: 6
    Last Post: 12-07-2008, 04:09 AM
  3. newbie question - if statements without conditions
    By c_h in forum C++ Programming
    Replies: 2
    Last Post: 07-18-2008, 10:42 AM
  4. Effecient Selection Statements?
    By 031003b in forum C++ Programming
    Replies: 1
    Last Post: 10-25-2007, 06:08 AM
  5. Efficiency of case statements
    By Yasir_Malik in forum C Programming
    Replies: 26
    Last Post: 05-23-2006, 11:36 AM