multi-ev_loop on UDP socket

Joachim Nilsson troglobit at
Mon Jun 4 14:44:19 CEST 2012

On Mon, Jun 4, 2012 at 2:29 PM, Marc Lehmann <schmorp at> wrote:
> On Mon, Jun 04, 2012 at 08:41:38AM +0800, 钱晓明 <mailtoantares at> wrote:
>> If there are more than one event loop on same udp socket, and each of
>> them in different thread, datagrams will be processed by all threads
>> concurrently? For example, one thread is processing udp message while
>> new message arrived, another thread would process this one immedately?
> Well, with luck, yes. Without luck, all your threads will try to process
> the same packet, but only one will succeed, and everything is slow and
> awkward :)

With luck?  Is it even possible to achieve something like that
without having one callback for the socket (per socket), sort
out each packet and then delegate further to other sockets
and callbacks?

Just curious since you're quite an authority on this type of
magic, Marc. :)


More information about the libev mailing list