> > Given the current code for SMS, it is hard to separate the 'scope' vs.
> > 'allocation' parent. Roy and I discussed yesterday about playing some
> > trickery with having the thread-specific SMS be parented by the std SMS
> > (i.e. malloc et al) and the per-process pool (i.e. passed into
> > thread_create) have the thread-specific SMS listed as a child. The
> > problem now becomes what happens when that thread-specific SMS is
> > cleaned up (voluntarily - like it will be 99% of the time)? You now
> > need to remove it from the per-process SMS's child list. This now
> > becomes an expensive operation. (The SMSs only store their next
> > sibling, not their previous sibling, so they can't easily remove
> > themselves from the list.)
>
> Now that's a specific flaw (one that can be solved.)
Look at the code again. Specifically in apr_sms_destroy. You'll see
there that the child sms is removed from the child list like so:
if ((*sms->ref = sms->sibling) != NULL)
sms->sibling->ref = sms->ref;
Which is an inexpensive operation.
Sander