httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Hyde <bh...@pobox.com>
Subject Fibers and thread local storage
Date Thu, 14 Jan 1999 19:12:16 GMT

I've heard rumors from Java fans that an NT thread is a huge monster
taking a big chunk of memory and it's a little slow around the context
switching.  Window's, as usual, has something else that people prefer: 
fibers.  We discussed these some time ago...

It is my impression that using fibers has one - and really only one
cost - e.g. we have to avoid thread local storage within request
processing. Can we manage that?

If one looks at the current cases it seems tractable.  There is a per
fiber data structure you can hang state off, and that provides an
escape valve for a few cases if needed.

It is already the case that we pass, as an argument to maybe all
routines within request processing that is like "the current (take
your pick) task/thread/activity/object" because the request processing
ever gets too far from the request's pool.  So the set of thread
locals is very limited, almost zero if you consider only the ones of
interest to requests.

So two questions:
1. Am I right?  Want fibers: avoid thread local storage within request
   processing - end of story.

2. This would be worth the effort to implement and the irritation
   of forswearing thread local storage most of the time.

 - ben

ps. I have a fantasy that it is a tractable project to switch to
    intra-process mutex, and fibers in the 1.3 code base, and that
    would kick the NT performance way up.

Mime
View raw message