in reply to Re^4: fork - child executes code outside of block
in thread fork - child executes code outside of block

To me fork() is essentially a three way branch or switch. I enclose all three parts in the same statement.

  • Comment on Re^5: fork - child executes code outside of block

Replies are listed 'Best First'.
Re^6: fork - child executes code outside of block
by ikegami (Patriarch) on Mar 29, 2018 at 12:55 UTC

    No you didn't; execution falls through. You're missing an exit in the parent branch.