On Mon, Dec 29, 2014 at 5:59 PM, Rob Hoelz <[email protected]> wrote:
> Hi there,
>
> I was investigating a problem with MoarVM and use of sockets in separate
> threads (https://github.com/MoarVM/MoarVM/issues/165).  The problem seems to
> be that when I call
>
> uv_read_start on a handle with loop A, and uv_run on loop B, uv_run returns
> immediately.  If I poke around in the handle and change the loop, all works,
> but I see that the loop is intended as a read-only field.  Scanning through
> uv.h, I see no public function to accomplish this; is there a recommended
> way
> to resolve this issue?
>
> Thanks,
> Rob

Handles are tied to the event loop that created them.  You can clone
them by sending them over an IPC pipe to another event loop; see
test/benchmark-multi-accept.c for a (rather elaborate) example[0].

Functionality for migrating handles comes up from time to time.  It
would make a nice addition to the API but it's probably not all that
easy to implement, particularly on Windows.

[0] https://github.com/libuv/libuv/blob/v1.x/test/benchmark-multi-accept.c

-- 
You received this message because you are subscribed to the Google Groups 
"libuv" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/libuv.
For more options, visit https://groups.google.com/d/optout.

Reply via email to