[Click] Sharing a Data Structure

Beyers Cronje bcronje at gmail.com
Mon May 9 10:08:46 EDT 2005


Hi David,

Have a look at AddressInfo and FTPPortMapper among a few. I think both
your examples below should work fine. I personally would implement
your scenario using 3 elements, one for your data structures and 2 for
accessing the data structures.

Standard click runs in one thread and no locking is required. Using
"./configure --enable-multithread=n" with "click-install -t n" option
allows you to configure click for multithreading. Have a look at
http://pdos.csail.mit.edu/papers/click:usenix01/ and search the click
mailing list for more information.

Regards

Beyers

On 5/9/05, David Fusté <f2308030 at est.fib.upc.edu> wrote:
> 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!
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>



More information about the click mailing list