[Click] Sharing a Data Structure

David Fusté f2308030 at est.fib.upc.edu
Mon May 9 07:11:32 EDT 2005


Hi,
I want to implement two different click elements.
I want to implement a data structure similar to a Forwarding Table but 
more complicated.
And moreover, I want these two click elements share this data structure 
(only this data structure, because the behaviour of the two click 
elements is different; for example, they  look up differently in the 
data structure).

What is the best solution to implement this in click?
- To implement the two click elements: one click element implementing 
(containing) the data structure and the other click element getting the 
name of the first click element via  the config string, to share the 
data structure?
- To implement  three click elements: one specific click element only 
for containing the data structure and the two other click elements 
getting the name of the specific click element, to share de data structure?
- Or, is there another better solution?

And finally, is click multithread? If click is multithread, is there the 
possibility of multiple access to the data structure by the two click 
elements at the same time? So, will the use of LOCK/MUTEX variables be 
necessary to implement this data structure?
If click is single thread, this problem does not exists...

Thank you very much!


More information about the click mailing list