▁an ▁array . ▁ ▁The ▁sum ▁is ▁a ▁shared ▁variable ▁and ▁is ▁read / written ▁in ▁each ▁iteration ▁of ▁the ▁loop . ▁ ▁In ▁sequ ential ▁code , ▁this ▁works ▁fine . ▁ ▁However , ▁if ▁you ▁try ▁to ▁parallel ize ▁ ▁the ▁loops ▁( each ▁loop ▁a ▁different ▁thread ), ▁then ▁the ▁wrong ▁sum ▁would ▁be ▁calculated . ▁ ▁In ▁this ▁case , ▁priv at ization ▁does ▁not ▁work . ▁ ▁You ▁cannot ▁priv at ize ▁the ▁sum ▁because ▁they ▁each ▁rely ▁on ▁each ▁other . ▁ ▁While ▁there ▁are ▁techniques ▁to ▁still ▁parallel ize ▁ ▁this ▁code , ▁simple ▁priv at ization ▁does ▁not ▁work . ▁ ▁// Sequ ential ▁Code : ▁// Ass ume ▁the ▁variables ▁have ▁already ▁been ▁declared ▁ ▁sum ▁= ▁ 0 ; ▁for ▁( int ▁i ▁= ▁ 0 ; ▁i ▁< ▁ 1 0 ; ▁i ++) ▁{ ▁▁▁▁ ▁sum ▁= ▁sum ▁+ ▁a [ i ]; ▁} ▁ ▁Priv at ization ▁in ▁Open ▁MP ▁ ▁Open MP ▁is ▁a ▁programming ▁language ▁that ▁supports ▁multip ro cess or ▁programming ▁with ▁shared ▁memory . ▁ ▁Because ▁of ▁this , ▁read / write ▁conflic ting ▁variables ▁will ▁und ou bt edly ▁occur . ▁ ▁In ▁these ▁cases , ▁Priv at ization ▁can ▁sometimes ▁be ▁used ▁to ▁allow ▁parallel ▁execution ▁of ▁the ▁code . ▁ ▁The ▁example ▁below ▁shows ▁ 2 ▁different ▁examples ▁of ▁code . ▁ ▁The ▁first ▁example ▁is ▁the ▁original ▁code ▁written ▁sequ entially . ▁ ▁This ▁example ▁includes ▁a ▁dependence ▁which ▁would ▁normally ▁prevent