in reply to Re^2: Unexpected output from fork (Win32)
in thread Unexpected output from fork (Win32)
A couple of things.
First, as Win32 pseudo-forks are threads, you can (apparently) use threads::shared to share an array (or other data) between them:
From threads::shared POD:
DESCRIPTION
By default, variables are private to each thread, and each newly created thread gets a private copy of each existing variable. This module allows you to share variables across different threads (and pseudoforks on Win32). It is used together with the threads module.
Though I admit I've never actually tried this.
Second. Doing the equivalent of your OP code using threads is much simpler.
|
|---|