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

Henning Rogge (spam-protected)
Wed Jul 30 07:50:16 CEST 2008


Hello,

I'm writing this down so we can talk about it and the idea doesn't get lost.

At the moment Olsrd has no support for multithreading. Instead of locking the 
mainloop from a (or multiple) plugin(s) I suggest we enhance the  
add_olsr_socket() function with an additional parameter called "realtime":

void add_olsr_socket(int fd, olsr_bool realtime, void(*pf)(int fd));

This way a plugin can decide if it needs to be contacted directly when a 
package arrives or if it can wait for the next polling cycle.

In the olsr_scheduler_sleep() function we can use a select() statement to wait 
for packages from all realtime sockets while using the timeout parameter to 
wait for the next polling cycle.

I think this sollution will be as flexible as a locking mechanism without 
needing support for multithreading at all.

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