[Olsr-dev] RFC: Infrastructure for plugins with sockets

Henning Rogge (spam-protected)
Wed Jul 30 12:34:45 CEST 2008


Am Mittwoch 30 Juli 2008 11:52:07 schrieb Bernd Petrovitsch:
> > At the moment Olsrd has no support for multithreading. Instead of locking
> > the
>
> Because the "core" doesn't really needs it - only 2 plugins IIRC.
it's useful for plugins transporting packages... most other plugins can wait 
for a few moments until they are called back by the core.

> > mainloop from a (or multiple) plugin(s) I suggest we enhance the
> > add_olsr_socket() function with an additional parameter called
> > "realtime":
>
> Can we rename it to "soon" or "immediate" something similar.
> "Realtime" already has a defined semantics in computer science - and it
> is not "as fast as possible" or anything near that (though lots of
> clueless people - mainly from sales departments et al.;-) - use it with
> that false meaning).
> The true meaning has to do with "meeting guaranteed deadlines in time in
> 100% of all cases" - which is not the case or intention here AFAIU.
of course... just a boolean flag to switch between "call me when the mainloop 
polling is activated" and "call me as soon as possible".

> > I think this sollution will be as flexible as a locking mechanism without
> > needing support for multithreading at all.
>
> As long as the called functions of this "immediate" sockets *do* *not*
> *block* in anyway possible for any reason.
> Read: the I/O (and all other operations) there *must* be *non-blocking*.
> Basically one should use e.g. only non-blocking file descriptors there
> (which rules FILE * out - or is there a non-blocking interface for FILE
> *?[0]) and handle -1 graceful.
> Otherwise we would allow at most one immediate socket. Or one has subtle
> problems which occur seldom and are not reproducible.
That's already necessary for our socket callbacks.

Henning

*************************************************
Diplom Informatiker Henning Rogge
Forschungsgesellschaft für
Angewandte Naturwissenschaften e. V. (FGAN) 
Neuenahrer Str. 20, 53343 Wachtberg, Germany
Tel.: 0049 (0)228 9435-961
Fax: 0049 (0)228 9435-685
E-Mail: (spam-protected)
Web: www.fgan.de
************************************************
Sitz der Gesellschaft: Bonn
Registergericht: Amtsgericht Bonn VR 2530
Vorstand: Dr. rer. nat. Ralf Dornhaus (Vors.), Prof. Dr. Joachim Ender 
(Stellv.)




More information about the Olsr-dev mailing list