"R. Kent Dybvig" <dyb_at_cs.indiana.edu> writes:
>> I've got an operational question: The description seems to indicate
>> that the sheer presence of a parameter leads to the allocation of
>> storage in each thread, whether the thread accesses the parameter or
>> not. Does this mean that, the more live parameters there are in the
>> system, the more expensive threads become?
>
> In implementation, yes. But my thread system is based on pthreads, and
> you'd have to have quite a few parameters to notice the difference in
> thread-creation or memory overhead. Applications don't typically use
> very many thread parameters in any case.
It's still a problem that you pay for something even if you don't use
it: As the number of loaded libraries that use parameters grows, so do
all of your threads. This is probably not a problem in a system with
(comparatively) heavyweight threads such as pthreads, but it is a
problem in systems where threads take up only a few words in the
absence of parameters. (Pure deep binding doesn't have this problem.)
(For reference, the Scheme 48 Scheme code contains 33 fluids---if
those were parameters, they would take up 33 slots in *each* thread,
which is significant given the lightweight nature of Scheme 48's
threads.)
Consequently, adopting parameters now restricts the choices available
to implementors and users later.
--
Cheers =8-} Mike
Friede, V?lkerverst?ndigung und ?berhaupt blabla
Received on Fri Feb 23 2007 - 12:06:06 UTC