librelist archives

« back to archive

Calling handlers: overhead and threads

Calling handlers: overhead and threads

From:
Antonie Henning
Date:
2014-09-01 @ 21:41
Friends of Click,

I hope someone will be able to help with these two related questions:

Is it a bad idea to call read/write handlers often e.g. per packet?
I.e to avoid using Tee, use write handlers between elements.

Also when calling handlers, (e.g reading a large route or mac table), does
this cause a blocking condition in the table element thread?

Thanks in advance

regards
A

Re: [click] Calling handlers: overhead and threads

From:
Roberto Riggio
Date:
2014-09-02 @ 06:57
Hi,

why don't you put a pointer to the element you want to call inside the
element from which you are making the handler call, e.g.:

a::A()

b::B(A_ELEMENT a)

In the configure method of B you can assign the pointer to a variable
and then you can call all the methods in A with no particular overhead.

R.

On 01/09/14 23:41, Antonie Henning wrote:
> Friends of Click,
> 
> I hope someone will be able to help with these two related questions:
> 
> Is it a bad idea to call read/write handlers often e.g. per packet?
> I.e to avoid using Tee, use write handlers between elements.
> 
> Also when calling handlers, (e.g reading a large route or mac table), 
does this cause a blocking condition in the table element thread?
> 
> Thanks in advance
> 
> regards
> A
> 
> 


-- 
--------------------------------------------------------
Roberto Riggio, Ph.D.
CREATE-NET
Future Networks (FuN)
Senior Researcher
Via alla Cascata 56/D - 38123 Povo Trento (Italy)
e-mail: roberto.riggio@create-net.org
Tel: (+39) 0461 408400 - interno/extension 1708
Fax: (+39) 0461 421157
http://www.create-net.org/~rriggio/
--------------------------------------------------------

The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited according to
the Italian Law 196/2003 of the Legislature. If you received this in
error, please contact the sender and delete the material from any
computer.

Le informazioni contenute in questo messaggio di posta elettronica e nei
file allegati sono da considerarsi strettamente riservate. Il loro
utilizzo e' consentito esclusivamente al destinatario del messaggio, per
le finalita' indicate nel messaggio stesso. Qualora riceveste questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla cancellazione del
messaggio stesso dal Vostro sistema. Trattenere il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo,
od utilizzarlo per finalita' diverse, costituisce comportamento
contrario ai principi dettati dal D. Lgs. 196/2003.

Re: [click] Calling handlers: overhead and threads

From:
Antonie Henning
Date:
2014-09-02 @ 11:35
Thanks Roberto,

If I understand this correctly, this method is the way ARPQuerier uses ARPTable?

When A and B elements are running on different threads, when B calls a 
method in A, which thread does the processing?

Apologies if this is obvious, its not clear to me.

Thanks.
A


On Tuesday, September 2, 2014 8:57 AM, Roberto Riggio 
<roberto.riggio@create-net.org> wrote:
 


Hi,

why don't you put a pointer to the element you want to call inside the
element from which you are making the handler call, e.g.:

a::A()

b::B(A_ELEMENT a)

In the configure method of B you can assign the pointer to a variable
and then you can call all the methods in A with no particular overhead.

R.

On 01/09/14 23:41, Antonie Henning wrote:
> Friends of Click,
> 
> I hope someone will be able to help with these two related questions:
> 
> Is it a bad idea to call read/write handlers often e.g. per packet?
> I.e to avoid using Tee, use write handlers between elements.
> 
> Also when calling handlers, (e.g reading a large route or mac table), 
does this cause a blocking condition in the table element thread?
> 
> Thanks in advance
> 
> regards
> A
> 
> 


-- 
--------------------------------------------------------
Roberto Riggio, Ph.D.
CREATE-NET
Future Networks (FuN)
Senior Researcher
Via alla Cascata 56/D - 38123 Povo Trento (Italy)
e-mail: roberto.riggio@create-net.org
Tel: (+39) 0461 408400 - interno/extension 1708
Fax: (+39) 0461 421157
http://www.create-net.org/~rriggio/
--------------------------------------------------------

The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited according to
the Italian Law 196/2003 of the Legislature. If you received this in
error, please contact the sender and delete the material from any
computer.

Le informazioni contenute in questo messaggio di posta elettronica e nei
file allegati sono da considerarsi strettamente riservate. Il loro
utilizzo e' consentito esclusivamente al destinatario del messaggio, per
le finalita' indicate nel messaggio stesso. Qualora riceveste questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla cancellazione del
messaggio stesso dal Vostro sistema. Trattenere il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo,
od utilizzarlo per finalita' diverse, costituisce comportamento
contrario ai principi dettati dal D. Lgs. 196/2003.

Re: [click] Calling handlers: overhead and threads

From:
Antonie Henning
Date:
2014-09-04 @ 14:36
Update:

Perhaps a method to avoid a blocking condition and to ensure that they 
continue to run on separate threads is to place the calls from the B 
element in a pending tasks queue on the A element.


On Tuesday, September 2, 2014 1:35 PM, Antonie Henning 
<antoniehenning@yahoo.com> wrote:
 


Thanks Roberto,

If I understand this correctly, this method is the way ARPQuerier uses ARPTable?

When A and B elements are running on different threads, when B calls a 
method in A, which thread does the processing?

Apologies if this is obvious, its not clear to me.

Thanks.
A


On Tuesday, September 2, 2014 8:57 AM, Roberto Riggio 
<roberto.riggio@create-net.org> wrote:
 


Hi,

why don't you put a pointer to the element you want
 to call inside the
element from which you are making the handler call, e.g.:

a::A()

b::B(A_ELEMENT a)

In the configure method of B you can assign the pointer to a variable
and then you can call all the methods in A with no particular overhead.

R.

On 01/09/14 23:41, Antonie Henning wrote:
> Friends of Click,
> 
> I hope someone will be able to help with these two related questions:
> 
> Is it a bad idea to call read/write handlers often e.g. per packet?
> I.e to avoid using Tee, use write handlers between elements.
> 
> Also when calling handlers, (e.g reading a large route or mac table), 
does this cause a blocking condition in the table element thread?
> 
> Thanks in advance
> 
> regards
> A
> 
> 


-- 
--------------------------------------------------------
Roberto Riggio, Ph.D.
CREATE-NET
Future
 Networks (FuN)
Senior Researcher
Via alla Cascata 56/D - 38123 Povo Trento (Italy)
e-mail: roberto.riggio@create-net.org
Tel: (+39) 0461 408400 - interno/extension 1708
Fax: (+39) 0461 421157
http://www.create-net.org/~rriggio/
--------------------------------------------------------

The information transmitted is intended only for the person or entity to
which it is addressed and may contain confidential and/or privileged
material. Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by persons or
entities other than the intended recipient is prohibited according to
the Italian Law 196/2003 of the Legislature. If you received this in
error, please contact the sender and delete the
 material from any
computer.

Le informazioni contenute in questo messaggio di posta elettronica e nei
file allegati sono da considerarsi strettamente riservate. Il loro
utilizzo e' consentito esclusivamente al destinatario del messaggio, per
le finalita' indicate nel messaggio stesso. Qualora riceveste questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla cancellazione del
messaggio stesso dal Vostro sistema. Trattenere il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo,
od utilizzarlo per finalita' diverse, costituisce comportamento
contrario ai principi dettati dal D. Lgs. 196/2003.