[OLSR-users] RE: Dot topology plugin

Ignacio García Pérez (spam-protected)
Thu Oct 21 13:44:01 CEST 2004


> Just some comments on the idea of multithreading the plugin.
> I do not believe this can be easily done. As soon as the plugin operates
> in a seperate thread from olsrd you have to start considering protecting
> critical sections. The access of the topology lists is one such section,
> and creating a locking scheme for this would not be possible withouth
> altering olsrd to be using some sort of protection on all write accesses
> to these lists(which is not going to happen).

I agree. OLSRD should not be modified. KISS as much as possible.

My approach would keep concurrent access protection inside the plugin. When
the event callback is called, it would make a local copy of the topology
lists. The local copy is the one protected by a mutex, and the client
threads use the local list. In fact, each thread makes a second local copy,
otherwise the "send() blocking" problem persists.

I agree this is memory consuming, but it largely depends on the size of the
network topoloy and the number of connected clients.

> I think you should consider making the socket non-blocking and do some
> transmission retries (or use select) if send returns EAGAIN which means it
> did not manage to transmit all data.

Not sure about this, but is there a chance that with a very large network
the underlying TCP buffers become full and return EAGAIN always at some
point in writing the DOT description ?

Nacho.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.778 / Virus Database: 525 - Release Date: 10/15/2004




More information about the Olsr-users mailing list