Switching to threads rather than using fork.