Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

threads::shared

4 réponses
Avatar
Scetbon Cyril
Salut,

je suis en train de me prendre la tête avec ce module pour passer une
variable en shared.
Voici ma variable en question: (désolé pour la longueur)

use threads;
use threads::shared;
my %oids : shared=();
%oids
=('0601040181240C030201020101'=>{name=>'atmNteAlarmIfEntry.atmInterfaceActiveAlarms',
next=>[qw/00 8801 8821 8822 8823 8824 8841 8861 8901/],
last=>[qw/0601040181240C0302010201028801 02020960/],
type=>'int',
val=>[qw/020100 020100 020100 020100 020100 020100 020101 020101
020100 02020960/]},

'0601040181240C030201050102'=>{name=>'atmNteAlarmVpEntry.atmNteVpActiveAlarms',
next=>[qw/0000 0109 2965/],
last=>[qw/0601040181240C030201060101010036 020100/],
type=>'int',
val=>[('020100')x4]},

'0601040181240C030201060103'=>{name=>'atmNteAlarmVcEntry.atmNteVcActiveAlarms',
next=>[qw/000000
010036/,(map{'0108'.sprintf("%2X",$_)}(30..50)),qw/010B3C 010B3D 010B3E
010F1E 010F1F 010F20 010F21
010F22 010F23/,(map{'1108'.sprintf("%2X",$_)}(30..50)),qw/110F1E
110F1F 110F20 110F21 110F22 110F23 650932 650933
650934 81450001 81450005 81450006 81450007 81450008 81450009 8145000A
8165817F21 8165817F2A/],
last=>[qw/0601040181240C050100 02032B123C/],
type=>'int',
val=>[('020100')x72,'02032B123C']},
'060102012501070101'=>{name=>'atmVclEntry.atmVclVpi',
next=>[qw/00868D20868D20 010036/,map{'0108'.sprintf("%2X",$_)}(30..49)],
last=>undef,
type=>'int',
val=>[qw/020100 020100/,('020108')x20]},
'060102012501070102'=>{name=>'atmVclEntry.atmVclVci',
next=>[qw/00868D20868D20 010036/,map{'0108'.sprintf("%2X",$_)}(30..49)],
last=>undef,
type=>'int',
val=>[map{'0201'.sprintf("%02X",$_)}(0,54,30..49)]},
'06010201250107010C'=>{name=>'atmVclEntry.atmVclCrossConnectIdentifier',
next=>[qw/00868D20868D20 010036/,map{'0108'.sprintf("%2X",$_)}(30..49)],
last=>undef,
type=>'int',
val=>['020100','020101',map{'0202'.sprintf("%04X",$_)}(936..955)]},

'0601020125010B010D'=>{name=>'atmVcCrossConnectEntry.atmVcCrossConnectRowStatus',
next=>[qw/01000000000000 010100368165817F21 8728000000000000
872801081E11081E 8729000000000000 872901081F11081F
872A000000000000 872A010820110820 872B000000000000 872B010821110821
872C000000000000 872C010822110822 872D000000000000
872D010823110823 872E000000000000 872E010824110824 872F000000000000
872F010825110825 8730000000000000 8730010826110826
8731000000000000 8731010827110827 8732000000000000 8732010828110828
8733000000000000 8733010829110829 8734000000000000
873401082A11082A 8735000000000000 873501082B11082B 8736000000000000
273601082C11082C 8737000000000000 873701082D11082D
8738000000000000 873801082E11082E 8739000000000000 873901082F11082F
873A000000000000 873A010830110830/],
last=>undef,
type=>'int',
val=>[('020101')x40]},

'0601020125010B0101'=>{name=>'atmVcCrossConnectEntry.atmVcCrossConnectIndex',
next=>undef,
last=>undef,
type=>'int',
val=>['020101','020101',map{('0202'.sprintf("%04X",$_))x2}(936..954)]},

'0601020125010B0102'=>{name=>'atmVcCrossConnectEntry.atmVcCrossConnectLowIfIndex',
next=>undef,
last=>undef,
type=>'int',
val=>[('020101')x40]},

'0601020125010B0103'=>{name=>'atmVcCrossConnectEntry.atmVcCrossConnectLowVpi',
next=>undef,
last=>undef,
type=>'int',
val=>[('020100')x2,('020108')x39]},

'0601020125010B0104'=>{name=>'atmVcCrossConnectEntry.atmVcCrossConnectLowVci',
next=>undef,
last=>undef,
type=>'int',
val=>[map{('0201'.sprintf("%2X",$_))x2}(54,30..48)]},

'0601020125010B0105'=>{name=>'atmVcCrossConnectEntry.atmVcCrossConnectHighIfIndex',
next=>undef,
last=>undef,
type=>'int',
val=>[('020200E5')x2,('020111')x39]},

'0601020125010B0106'=>{name=>'atmVcCrossConnectEntry.atmVcCrossConnectHighVpi',
next=>undef,
last=>undef,
type=>'int',
val=>[('020200FF')x2,('020108')x39]},

'0601020125010B0107'=>{name=>'atmVcCrossConnectEntry.atmVcCrossConnectHighVci',
next=>undef,
last=>undef,
type=>'int',
val=>[map{('0201'.sprintf("%2X",$_))x2}(33,30..48)]},
'0601020101'=>{name=>'system.sys',
next=>[qw/0100 0200 0500 0400 0600 0300/],
last=>undef,
type=>'str',

val=>[qw/04647261644143452D323030322041544D2F495746204E54552048573A302E322D492F302E312D412C20426F6F743A20312E3120312D32392D323030312031333A30372C204170706C69636174696F6E3A20322E353120382D352D323030332031353A30342E
060C2B06010401812406010C0206 040953696D756C61746F72
041053696D756C617465757220437972696C 040648696464656E 43040E04AE6D/]},
'06010401812406020E'=>{name=>'systemTiming.system',
next=>[qw/0100 0200/],
last=>undef,
type=>'str',
val=>[qw/040A323030332D31312D3238 040831373A32343A3234/]},
'0601040181240C030102'=>{name=>'atmNte',
next=>[qw/0600 01010206 01010207 01010408 01010409 0101040A
0101040B 01010306/],
last=>undef,
type=>'int',
val=>[qw/020102 020100 020100 020107 02011D 020107 020115 0400/]},
'0601020102'=>{name=>'interfaces.ifNumber',
next=>[qw/0100/],
last=>undef,
type=>'int',
val=>[qw/02011A/]},
'06010401812406020A'=>{name=>'agnt.agnLed',
next=>[qw/00/],
last=>undef,
type=>'str',
val=>[qw/041988974444008800000000888800000044000000004808000000/]},
'0601040181240C030101'=>{name=>'atmNteSysConfig',
next=>[qw/1200/],
last=>undef,
type=>'int',
val=>[qw/020102/]},
'0601040181240602190103'=>{name=>'systemPsEntry',
next=>[qw/0101 0201/],
last=>undef,
type=>'int',
val=>[qw/020102 020101/]},

'0601040181240C03020102010A'=>{name=>'atmNteAlarmIfEntry.atmInterfaceActiveAlarmsStatus',
next=>[qw/8801 8821 8822 8823 8824 8841 8861/],
last=>undef,
type=>'int',
val=>[qw/020102 020102 020102 020102 020102 020103 020103/]},
'0601040181240602'=>{name=>'enterprises.rad.radGen.agnt',
next=>[qw/0800 1600 1901030101 1901030201/],
last=>undef,
type=>'int',
val=>[qw/020103 020102 020102 020101/]},
'0601020102020103'=>{name=>'interfaces.ifTable.ifEntry.ifType',
next=>[qw/00 01 11 29 65 8105 8106 8107 8108 8145 8165 8205 8801 8821
8822 8823 8824 8841 8861 8901
8921/,(map{('9'.sprintf("%03X",$_))}(513..639)),'9300',(map{('AA'.sprintf("%02X",$_))}(1..124)),(map{('C6'.sprintf("%02X",$_))}(1..123)),'E00D'],
last=>[qw/060102010202010401 020100/],
type=>'int',

val=>['020100',('020125')x3,('020150')x8,'02011E',('020112')x4,'02011E','02013E',('020101')x2,('020151')x127,('020152')x124,('020101')x125]},
'0601020102020102'=>{name=>'interfaces.ifTable.ifEntry.ifDescr',
next=>[qw/00 01 11 29 65 8105 8106 8107 8108 8145 8165 8205 8801 8821
8822 8823 8824 8841 8861 8901
8921/,(map{('9'.sprintf("%03X",$_))}(513..639)),'9300',(map{('AA'.sprintf("%02X",$_))}(1..124)),(map{('C6'.sprintf("%02X",$_))}(1..123)),'E00D'],
last=>[qw/060102010202010301 020125/],
type=>'int',
val=>[qw/00
043241544D206C617965722028636172642045332920736C6F742031202F207068795F706F72743A204453332031283130323529
043241544D206C617965722028636172642045332920736C6F742033202F207068795F706F72743A204453332031283130383929
043641544D206C617965722028636172642054554E4E454C2920736C6F742036202F207068795F706F72743A2054554E2031283131383529
043141544D20566972742028636172642045332920736C6F742031202F207068795F706F72743A204453332031283130323529
043641544D2056697274202863617264204345535F4531342920736C6F742032202F207068795F706F72743A204453312031283130353729
043641544D2056697274202863617264204345535F4531342920736C6F742032202F207068795F706F72743A204453312032283130353829
043641544D2056697274202863617264204345535F4531342920736C6F742032202F207068795F706F72743A204453312033283130353929
043641544D2056697274202863617264204345535F4531342920736C6F742032202F207068795F706F72743A204453312034283130363029
043441544D2056697274202863617264204554482920736C6F742034202F207068795F706F72743A2046734574682031283131323129
043241544D2056697274202863617264205341522920736C6F742035202F207068795F706F72743A205341522031283131353329
043541544D20566972742028636172642054554E4E454C2920736C6F742036202F207068795F706F72743A2054554E2031283131383529
042C4453332028636172642045332920736C6F742031202F207068795F706F72743A204453332031283130323529
0431445331202863617264204345535F4531342920736C6F742032202F207068795F706F72743A204453312031283130353729
0431445331202863617264204345535F4531342920736C6F742032202F207068795F706F72743A204453312032283130353829
0431445331202863617264204345535F4531342920736C6F742032202F207068795F706F72743A204453312033283130353929
0431445331202863617264204345535F4531342920736C6F742032202F207068795F706F72743A204453312034283130363029
042C4453332028636172642045332920736C6F742033202F207068795F706F72743A204453332031283130383929
04384661737445746865726E6574202863617264204554482920736C6F742034202F207068795F706F72743A2046734574682031283131323129
042D534152202863617264205341522920736C6F742035202F207068795F706F72743A205341522031283131353329
043944554D4D592054756E6E656C2028636172642054554E4E454C2920736C6F742036202F207068795F706F72743A2054554E2031283131383529/,(map{'0431445330202863617264204345535F4531342920736C6F742032202F207068795F706F72743A204453312031283130'.$_}
('353729')x32,('353829')x32,('353929')x32,('363029')x32),(map{'043744533042756E646C65202863617264204345535F4531342920736C6F742032202F207068795F706F72743A204453312031283130'.$_}
('353729')x32,('353829')x32,('353929')x32,('363029')x32),('043742726964676520706F7274202863617264204554482920736C6F742034202F207068795F706F72743A2046734574682031283131323129')x121]},

'06010401812414020103020101'=>{name=>'apsMap.apsMapTable.apsMapEntry.apsMapIfIndex',
next=>[qw/00/],
last=>[qw/0601040182610502020104010100 0400/],
type=>'obj',
val=>[qw/020100/]},

'06010401812414020103020102'=>{name=>'apsMap.apsMapTable.apsMapEntry.apsMapGroupName',
next=>[qw/00/],
last=>[qw/0601040182610502020104010100 0400/],
type=>'obj',
val=>[qw/020100/]},

'06010401812414020103020103'=>{name=>'apsMap.apsMapTable.apsMapEntry.apsMapChanNumber',
next=>[qw/00/],
last=>[qw/0601040182610502020104010100 0400/],
type=>'obj',
val=>[qw/020100/]});

$oids{'0601020125010B010'.$_}->{next}=$oids{'0601020125010B010D'}->{next}
for (1..7);

A la compilation aucun problème, mais à l'exécution un joyeux "Invalid
value for shared scalar at pipo.txt line 136."

Une idée, pour faire fonctionner l'exécution et ne pas avoir trop de
modifs à apporter ?

Merci

4 réponses

Avatar
DominiX
ici même:c4k0gi$,
Scetbon Cyril a écrit
Salut,

je suis en train de me prendre la tête avec ce module pour passer une
variable en shared.
Voici ma variable en question: (désolé pour la longueur)



illisible, si tu veux une reponse donne un exemple concis.

--
dominix

Avatar
Scetbon Cyril
DominiX wrote:
ici même:c4k0gi$,
Scetbon Cyril a écrit

Salut,

je suis en train de me prendre la tête avec ce module pour passer une
variable en shared.
Voici ma variable en question: (désolé pour la longueur)




illisible, si tu veux une reponse donne un exemple concis.

use threads;

use threads::shared;
my %oids : shared=();
%oids
=('0601040181240C030201020101'=>{name=>'atmNteAlarmIfEntry.atmInterfaceActiveAlarms',
next=>[qw/00 8801 8821 8822 8823 8824 8841 8861 8901/],
last=>[qw/0601040181240C0302010201028801 02020960/],
type=>'int',
val=>[qw/020100 020100 020100 020100 020100 020100 020101
020101 020100 02020960/]});

--
dominix





Avatar
DominiX
ici même:40705768$0$14171$,
Scetbon Cyril a écrit
DominiX wrote:
ici même:c4k0gi$,
Scetbon Cyril a écrit

Salut,

je suis en train de me prendre la tête avec ce module pour passer
une variable en shared.
Voici ma variable en question: (désolé pour la longueur)




illisible, si tu veux une reponse donne un exemple concis.

use threads;

use threads::shared;
my %oids : shared=();
%oids

=('0601040181240C030201020101'=>{name=>'atmNteAlarmIfEntry.atmInterfaceActiv

eAlarms',
next=>[qw/00 8801 8821 8822 8823 8824 8841 8861 8901/],
last=>[qw/0601040181240C0302010201028801 02020960/],
type=>'int',
val=>[qw/020100 020100 020100 020100 020100 020100 020101
020101 020100 02020960/]});



et ça est ce que ça te convient ?

pastis tmp # cat toto
use threads;
use threads::shared;
my %oids = ('name' => {name=>'etc',
next=>[qw/00 88 61 1/],
last=>[qw/0100/],
type=>'int',
val => [qw/0 2 100 960/]
}
);
share( %oids );



Avatar
Scetbon Cyril
ça passe.
Merci mais j'ai changé d'avis après la consommation mémoire demandée par
thread. Comme quoi je ne suis par encore prêt à utiliser les threads en
perl sauf pour un nombre peu important de threads.

DominiX wrote:
ici même:40705768$0$14171$,
Scetbon Cyril a écrit

DominiX wrote:

ici même:c4k0gi$,
Scetbon Cyril a écrit


Salut,

je suis en train de me prendre la tête avec ce module pour passer
une variable en shared.
Voici ma variable en question: (désolé pour la longueur)




illisible, si tu veux une reponse donne un exemple concis.



use threads;
use threads::shared;
my %oids : shared=();
%oids



=('0601040181240C030201020101'=>{name=>'atmNteAlarmIfEntry.atmInterfaceActiv
eAlarms',

next=>[qw/00 8801 8821 8822 8823 8824 8841 8861 8901/],
last=>[qw/0601040181240C0302010201028801 02020960/],
type=>'int',
val=>[qw/020100 020100 020100 020100 020100 020100 020101
020101 020100 02020960/]});




et ça est ce que ça te convient ?

pastis tmp # cat toto
use threads;
use threads::shared;
my %oids = ('name' => {name=>'etc',
next=>[qw/00 88 61 1/],
last=>[qw/0100/],
type=>'int',
val => [qw/0 2 100 960/]
}
);
share( %oids );