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).
In reply to Re: Sharing in fork
by ikegami
in thread Sharing in fork
by ajeet@perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |