Chromium Code Reviews
Descriptionforwarder2: Make the Forwarder instances operate on a single thread.
The Forwarder class used to operate on its own internal thread. This was
leading to e.g. 256 threads being spawned since Chrome keeps a lot of sockets
around in its socket pool.
This CL makes the ForwarderManager have an internal thread performing a single
select() on all the socket file descriptors and it notifies all the Forwarder
instances when some events occur.
The fact that ForwarderManager has an internal thread that joins on destruction
also makes the interactions between ForwarderManager and its clients much
simpler. In particular it allows us to remove its ref-counted thread-safe
delegate.
This CL should make the device_forwarder daemon more lightweight and make the
results in page_cyclers hopefully more stable.
The internal buffer used to forward the traffic is also shrunk to 32 KBytes
since 128 KBytes was way too big (read() rarely returns more than 16 KBytes).
BUG=332403
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=247694
Patch Set 1 #
Total comments: 2
Patch Set 2 : Address Benjamin's offline comments #
Total comments: 2
Patch Set 3 : Address Benjamin's comments #Patch Set 4 : Move |kBufferSize| to an anonymous namespace #Patch Set 5 : Create ScopedClosureRunner later #
Total comments: 7
Patch Set 6 : Address David's comment #
Messages
Total messages: 12 (0 generated)
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||