examples/os/fork_load.py
from __future__ import print_function
import os
import random

n = 8
for p in range(0, n):
  pid = os.fork()
  if not pid:
    print('In Child')
    i = 0
    while i < 10000000:
      x = random.random()
      y = random.random()
      z = x+y
      i += 1
    exit(3)
  print('In Parent of', pid)

for p in range(0, n):
  r = os.wait()
  print(r)