I am 100% in favor of switching to asynchronous read instead of read_start. However I think you want to stick with alloc_cb unless you can think of something better.
Imagine you have 10k open tcp connections that all *may* receive data. Then you are pre-allocating 64k * 10k = 640mb of buffers alone, which are almost never used. With alloc_cb, libuv can ask the embedder to allocate memory as late as possible. For TCP handles buffers can be allocated very much "last minute", while for operations that happen in the thread pool the buffer can be allocated upfront. - Bert > -----Original Message----- > From: [email protected] [mailto:[email protected]] On Behalf > Of Saúl Ibarra Corretgé > Sent: Monday, June 30, 2014 3:09 PM > To: [email protected] > Subject: Re: [libuv][FRC] Replace uv_read_start/stop with uv_read > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 06/30/2014 02:53 PM, Andrius Bentkus wrote: > > Well, there is no alloc_cb in uv_read. > > > > > > alloc_cb allows for libuv to eventually call IOCTL(FIONREAD) to check > > exactly how much there is to read. > > > > This api wouldn't allow this possibility. Currently the implementation > > uses just 64k so it doesn't matter I guess. > > > > Are you currently relying on that (use of alloc_cb)? > > - -- > Saúl Ibarra Corretgé > bettercallsaghul.com > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1 > Comment: Using GnuPG with Icedove - http://www.enigmail.net/ > > iQIcBAEBAgAGBQJTsWFgAAoJEEEOVVOum8BZnCQP/RNfHyIUXe8iy8xRZMh8Gc > Rl > m6zwhmxRg9BsxRWyzHufHtkDmIw1OGoD5+MKYNam8Ww96K6kD/wzJGdDnq > u64MNs > wMEV5DES8UUxtMNc2l2QcvVsPmWtFEIe5znFCfKznPADyepMuBMzkiL22eOtD > WrC > jj4jq/Fze462zlzGd4XBijYTCY4/N0vF2jqi49ezPcHqCABC/QugwLrY+P0ezswu > UPCK2OFnzow821g2q2CQp0OlYrhHUzIW3hby20LeH/MWjlQBcQD6wlSVxKcED > NLU > C8MIiM9sVGgQ5yys3wDLh8Rut6kqUdBE/Ee5tYE1tRd7vvjgQTdnbhCJ9ImAjFHv > OiwjQSXetQQ0ODDBbmT5CH+ZZJ0fqbZUBfaiZR0K+l7NbbOWDmdMGptxpPW6 > V8zn > vcKPzWG7Tb8v4fuXwEPtB/5gkpSnVqvuEwylCZVnttszxaTIqpkX545W2EuY3aGR > g6xv7pzVSmOTaAo3gLqAni9SE3UgUOMgimkho0rDEz17VyTY9E8oZERBiHypI3Tk > JkL0uW1OhfgR8bjL5vjYBw+0mNf0P7x94hpVCoY8ROyTA/ckRQTBk2vd8FOpTAA > K > BEhabS1xMfvaKLQ6VaAGmbSeLJXL7Cy0OvC5wONTBbDTeKZindWHAtt+HtOgm > TM9 > 4RddbjrxzV2mhRj+nlce > =vVG/ > -----END PGP SIGNATURE----- > > -- > 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.
