how to write codes "parbegin(p1,p2)" ?

for the pseudocode "parbegin(p1,p2)"
how to write codes?

p1,p2 are threads function.

void p1()
{
...
}

void p2()
{
...
}

void main()
{
parbegin(p1,p2);
}

zhshqzyc
View Public Profile
Find all posts by zhshqzyc
Add zhshqzyc to Your Buddy List

I am going to implement Dekker's algorithm to guarantee mutex exclusion between P1 and P2.

void p1()
     {
         "Dekker's algorithm ..."
     }

void p2()
    {
         "Dekker's algorithm ..."
    } 


   void main()
  {
      parbegin(p1,p2);
       ...
  }

Should I use "fork" or others?

Thanks!

Well. No one can answer this simple answer. I am despaired. It looks like no expert here.