> Am 24.06.2015 um 16:14 schrieb Eric Covener <cove...@gmail.com>: > > On Wed, Jun 24, 2015 at 10:07 AM, Stefan Eissing > <stefan.eiss...@greenbytes.de> wrote: >> Hmm, yes, well. It's the thought that counts... ;-) >> >> I think this will not be enough, though, if I understood the failures of my >> various attempts correctly. But it will certainly be good if more heads than >> one have a go at this. >> >> Let Tm :-= main thread, Tw := worker thread, TmB() the main connection >> bucket brigade, TwB() the worker (request) brigade. >> >> When a response from a worker starts: >> TmB( , , , , , , , ) TwB(b1,b2,b3, , , , ) >> so we move buckets across threads >> TmB(b1,b2, , , , , , ) TwB(b3, , , , , , ) >> and send b1 out and new response data arrives >> TmB(b2, , , , , , , ) TwB(b3,b4, , , , , ) >> we have the destruction of b1 and the creation of b4 that go against the >> same bucket_alloc_t instance from two threads. >> >> Similar operations happen when b1 needs to be split or is a file bucket that >> gets read. So refraining from destroying buckets in the main thread is not >> enough. >> >> Have I missed something here? > > > One thing I missed was that the httpd thread did the writing vs the h2 > thread. I thought the workers wrote but were serialized by the httpd > thread.
I see. I was afraid of too many thread switches/waits/sync during main connection writes. For streams of same priority, h2 wants round-robin frames of streams to come out, preferably. Ideally, I thought, for static file resources at least, the httpd thread would have all the file buckets in its buffers and read from them directly. With that goal in mind, I thought about moving things from h2 thread to httpd. > -- > Eric Covener > cove...@gmail.com <green/>bytes GmbH Hafenweg 16, 48155 Münster, Germany Phone: +49 251 2807760. Amtsgericht Münster: HRB5782