On Thu, Mar 28, 2013 at 03:55:54PM +0800, Liu Ping Fan wrote: > From: Liu Ping Fan <pingf...@linux.vnet.ibm.com> > > Attach each hubport with a GSource. Currently the GSource is attached > to default main context, and the hub still run on iothread, but in > future, after making the whole layer thread-safe, we will admit ports > to run on different thread. > > Signed-off-by: Liu Ping Fan <pingf...@linux.vnet.ibm.com> > --- > hw/qdev-properties-system.c | 1 + > include/net/queue.h | 14 ++++++++++++++ > net/hub.c | 34 ++++++++++++++++++++++++++++++++-- > net/net.c | 1 + > net/queue.c | 4 ++-- > 5 files changed, 50 insertions(+), 4 deletions(-)
There are two possibilities when a hub is used: 1. All net clients on the hub run in the same event loop. We don't need any code changes to make this work. 2. Net clients run in different event loops. I don't think this case matters, let's forbid it. It's not worth adding more complexity to the net subsystem in order to support it. Can you think of a use case that is well-served by net clients in multiple event loops? Stefan