S
Sébastien Cottalorda
Hi all,
I need to use that kind of shared hash:
%shared_hash = (
'123456' => {
'bla' => 123,
'bli' => 465,
ect ...
},
ect ...
);
with about 500 primary keys.
When I "feed" the %shared_hash, I note that the system create as many
shared segment and semaphore than there are primary keys.
As you can imagine, my process died with "Could not create semaphore
set: No space left on device at line ..."
If I create small complex structure (10 primary keys), the program works
perfectly.
If I well understand the perldoc IPC::Shareable documentation, I can
create as complex shared structure I want, I don't understand why it
crashes.
Here is a simple code that ever crash:
#!/usr/bin/perl -w
use strict;
use IPC::Shareable;
my $glue = 'data';
my %options = (
create => 1,
exclusive => 1,
mode => 0644,
destroy => 1,
);
my %colours;
tie %colours, 'IPC::Shareable', $glue, { %options } or
die "server: tie failed\n";
my ($i,$j);
for $i (1 .. 300){
for $j (1..3){
$colours{$i}{$j} = "fall";
print " 500 ... \n" if ($i==500);
print "1000 ... \n" if ($i==1000);
print "1500 ... \n" if ($i==1500);
print "2000 ... \n" if ($i==2000);
}
}
print "Charged - Press a key to continue -\n";
my $e=<STDIN>;
foreach $i ( keys %colours){
print "$i => \n";
foreach $j (keys %{$colours{$i}}){
print " $colours{$i}{$j}\n";
}
}
exit;
If someone as a clue ?
Thanks in advance for any help.
Sebastien
I need to use that kind of shared hash:
%shared_hash = (
'123456' => {
'bla' => 123,
'bli' => 465,
ect ...
},
ect ...
);
with about 500 primary keys.
When I "feed" the %shared_hash, I note that the system create as many
shared segment and semaphore than there are primary keys.
As you can imagine, my process died with "Could not create semaphore
set: No space left on device at line ..."
If I create small complex structure (10 primary keys), the program works
perfectly.
If I well understand the perldoc IPC::Shareable documentation, I can
create as complex shared structure I want, I don't understand why it
crashes.
Here is a simple code that ever crash:
#!/usr/bin/perl -w
use strict;
use IPC::Shareable;
my $glue = 'data';
my %options = (
create => 1,
exclusive => 1,
mode => 0644,
destroy => 1,
);
my %colours;
tie %colours, 'IPC::Shareable', $glue, { %options } or
die "server: tie failed\n";
my ($i,$j);
for $i (1 .. 300){
for $j (1..3){
$colours{$i}{$j} = "fall";
print " 500 ... \n" if ($i==500);
print "1000 ... \n" if ($i==1000);
print "1500 ... \n" if ($i==1500);
print "2000 ... \n" if ($i==2000);
}
}
print "Charged - Press a key to continue -\n";
my $e=<STDIN>;
foreach $i ( keys %colours){
print "$i => \n";
foreach $j (keys %{$colours{$i}}){
print " $colours{$i}{$j}\n";
}
}
exit;
If someone as a clue ?
Thanks in advance for any help.
Sebastien