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

Hannes Gredler (spam-protected)
Wed Jul 30 08:26:57 CEST 2008


On Wed, Jul 30, 2008 at 07:50:16AM +0200, Henning Rogge wrote:
| 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.

looks good to me - no objection. - /hannes




More information about the Olsr-dev mailing list