Luv is still single threaded. I'm pretty sure that the libuv writes are
put in a queue. Your strings will never get chopped up even if another
coroutine tries to write to the same socket.
On Jul 17, 2015 4:55 PM, "Wes Chow" <[email protected]> wrote:
> Apologies if this isn't the right place for a luv question...
>
> If I have two coroutines which each simultaneously do two socket:write
> operations to the same socket, s:
>
> s:write("foo")
> s:write("bar")
>
> I assume that there's a possibility the writes get interleaved. Ie, it's
> possible that "foofoobarbar" goes out on the socket, and that it might also
> be possible that "foobarfoobar" goes out.
>
> However, if I do this in two coroutines simultaneously:
>
> s:write("foobar")
>
> Am I guaranteed that data will go out as "foobarfoobar"? Or is it still
> possible that data gets interleaved within two write calls?
>
> Thanks,
> Wes
>
> --
> You received this message because you are subscribed to the Google Groups
> "luvit" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"luvit" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.