I can't tell for sure, but it looks as if you increment in the parent and decrement in the child. When you fork, the child is a copy of the parent. What it does to its variables has no effect on the parent. Using a reference for your counter won't help this because it would still be a reference to the child's copy of the counter. What you'll need to do is have the parent do the decrement when it waits for the child.
In reply to Re: Another Pass By Reference question
by kyle
in thread Another Pass By Reference question
by gokuraku
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |