Rémi Denis-Courmont wrote: > > I have started out by doing the RTNL handling async, > > i.e. registering the RTNL socket with g_io_add_watch etc. > > But I'm not really happy with the code as it feels > > unnecessary complex, introduces new states in gprs-context.c. etc. > > Using an event loop makes sense if, and only if, the process blocks as > far as poll() is concerned. If your ioctl() calls or Netlink requests > do not enter the kernel scheduler at any point, then the glib main > loop will just slows things down - more code, more context switches.
Thanks Denis, I think a synchronous implementation should be find then. If I understand RT-Netlink correctly, creating a CAIF Network Interface should not enter the poll() or wait in recvmsg. When sending RTNL newlink message, the whole newlink operation should execute in the senders thread, and response messages be ready in the rtnl sockets receive queue when the send operation completes. Hence read/poll should not block the thread. Regards /Sjur _______________________________________________ ofono mailing list [email protected] http://lists.ofono.org/listinfo/ofono
