bench: fix loop starvation bug
Don't keep writing until the write queue fills up. On fast systems (mine), that never happens - the data is sent out as fast as the benchmark generates it.
This commit is contained in:
parent
09b022232a
commit
c252bcb3f0
@ -203,12 +203,10 @@ static void do_write(uv_stream_t* stream) {
|
||||
buf.base = (char*) &write_buffer;
|
||||
buf.len = sizeof write_buffer;
|
||||
|
||||
while (stream->write_queue_size == 0) {
|
||||
req = (uv_write_t*) req_alloc();
|
||||
r = uv_write(req, stream, &buf, 1, write_cb);
|
||||
ASSERT(r == 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void connect_cb(uv_connect_t* req, int status) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user