Hello!

The interleaving cannot happen. We guarantee this :)

If it does - this is just a bug.

Cheers,
Fedor.


On Tue, Jun 3, 2014 at 11:42 AM, Nicolas Hillegeer <
[email protected]> wrote:

> Hi!
>
> From browsing the internet I got the impression that this sequence of
> events is possible:
>
> alloc_cb();
> alloc_cb();
> read_cb();
> read_cb();
>
> So I set out to guard against that (but using multiple buffers and setting
> a "in use" flag).
> However, when I look at this test:
> https://github.com/joyent/libuv/blob/master/test/test-stdio-over-pipes.c
> I notice that this wouldn't be correct under such a situation, as
> "output_used" is only incremented
> in the read_cb and not the alloc_cb. So two calls to alloc_cb() without an
> intermittent call
> to read_cb() would receive the same buffer.
>
> A cursory inspection of the uv-win code (which is the platform where it is
> mentioned this might
> occur due to IOCP), doesn't make it clear to me that interleaving can or
> cannot happen, since
> I don't know IOCP. It doesn't look like it to me, but I'd rather ask and
> be sure.
>
> Thanks for the help!
>
> NOTE: I'm talking to reads on the same handle, not on different handles.
>
> --
> 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.
>

-- 
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