in reply to Sharing in fork
i want to share my data among threads, which are created using forks.
Which one is it? Are you using threads or forked processes? I'm guessing the latter. Each process has its own memory space, so changes to a variable in one process isn't going to change the anything in another process. You need to setup a pipe, some shared memory or some other communication channel between the processes if you want to communicate between them. And maybe use a higher level interface over that channel (e.g. Cache::Mmap, forks, etc).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sharing in fork
by ajeet@perl (Acolyte) on Mar 23, 2010 at 08:27 UTC | |
by almut (Canon) on Mar 23, 2010 at 08:55 UTC | |
by ajeet@perl (Acolyte) on Mar 23, 2010 at 10:00 UTC | |
by almut (Canon) on Mar 23, 2010 at 12:26 UTC | |
by Corion (Patriarch) on Mar 23, 2010 at 10:02 UTC | |
| |
|
Re^2: Sharing in fork
by ajeet@perl (Acolyte) on Mar 24, 2010 at 05:56 UTC | |
by ikegami (Patriarch) on Mar 24, 2010 at 23:51 UTC |