Closed GoogleCodeExporter closed 8 years ago
Looking at the final representation of the connection sequence it seems like
the processing order is last in first out.
Original comment by mingo...@gmail.com
on 26 Mar 2012 at 10:22
On this secction of code:
// Wrap pointers if needed
while (ctx->sq_tail > (int) ARRAY_SIZE(ctx->queue)) {
ctx->sq_tail -= ARRAY_SIZE(ctx->queue);
ctx->sq_head -= ARRAY_SIZE(ctx->queue);
}
Do we expect to iterate more than once ?
An if isn't enough ?
Original comment by mingo...@gmail.com
on 26 Mar 2012 at 10:42
Also on this section of code:
// Copy socket from the queue and increment tail
*sp = ctx->queue[ctx->sq_tail % ARRAY_SIZE(ctx->queue)];
Why "ctx->sq_tail % ARRAY_SIZE(ctx->queue)" ?
We expect ARRAY_SIZE to be smaller than ctx->sq_tail ?
If not, this isn't be enough "*sp = ctx->queue[ctx->sq_tail];" ?
Original comment by mingo...@gmail.com
on 26 Mar 2012 at 10:57
Also here and in other places that do the same:
if (ctx->sq_head - ctx->sq_tail < (int) ARRAY_SIZE(ctx->queue)) {
// Copy socket to the queue and increment head
Why "ctx->sq_head - ctx->sq_tail" ?
This isn't enough "if (ctx->sq_head < (int) ARRAY_SIZE(ctx->queue)) " ?
Original comment by mingo...@gmail.com
on 26 Mar 2012 at 11:06
Unless requests are pipelined, which is not in you case I think, they are going
to be processed by separate threads. This means, there is no order guarantee
whatsoever, cause there is no such thing as processing order. Requests are
getting into the socket queue in one order, but picked up by different threads.
Since GET request is cheaper to process, there should be no surprise it is
executed faster.
Original comment by valenok
on 27 Mar 2012 at 12:57
Original issue reported on code.google.com by
mingo...@gmail.com
on 26 Mar 2012 at 10:19