I don't know how to get informations from my objects array with threads::shared; Show you, a piece of code :
Thank You !my @map; sub init_map { my ($X, $Y) = @_; for ($i = 0; $i < $Y; $i++) { for ($j = 0; $j < $X; $j++) { $map[$i][$j] = Case->new(); } } } sub events_callbacks { # my SDL events callbacks # display informations from @map # I don't know how to access the @map array # ... } sub launch { init_map 60, 60; # I have to get informations from @map In this func # This is $thr = threads->new(\&events_callbacks); # In this function I communicate with a server # and modify informations from @map talk; $thr->join; }
In reply to How to share an objects array between threads ? by Tyr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |