You are viewing a plain text version of this content. The canonical link for it is here.
Posted to websh-dev@tcl.apache.org by "David N. Welton" <da...@dedasys.com> on 2002/07/25 02:10:16 UTC

what is the point of 'initial' ?

It appears to be this:

    if (initial) {
	Tcl_CreateThreadExitHandler(dRequestData, (ClientData) requestData);
    }

but CreateThreadExitHandler does this:

        Tcl_CreateThreadExitHandler arranges for proc to be invoked by
        Tcl_FinalizeThread and Tcl_ExitThread.

And those aren't called anywhere that I can see...

Am I missing something?

-- 
David N. Welton
   Consulting: http://www.dedasys.com/
     Personal: http://www.dedasys.com/davidw/
Free Software: http://www.dedasys.com/freesoftware/
   Apache Tcl: http://tcl.apache.org/

---------------------------------------------------------------------
To unsubscribe, e-mail: websh-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-dev-help@tcl.apache.org


Re: what is the point of 'initial' ?

Posted by Ronnie Brunner <ro...@netcetera.ch>.
I had to hack something yesterday to fix the memory leak: the problem
is as follows: up to now Tcl_CreateThreadExitHandler was called every
time when an interp was created. This left some stuff lying around
when the interpreter was killed.
So I tried to make sure it's only called initially (hence: if (initial)), 
because the original if clause checking for Tcl_GetMaster doesn't do
the job. 
However: the problem now is: why did Simon use Tcl_CreateThreadExitHandler
in the first place. Is it really to be called on thread exit or rather
on interp deletion? or at program exit? I have to look into this to
hopefully avoid that shitty "initial" hack you found in the repository.

Any hints are welcome.


> It appears to be this:
> 
>     if (initial) {
> 	Tcl_CreateThreadExitHandler(dRequestData, (ClientData) requestData);
>     }
> 
> but CreateThreadExitHandler does this:
> 
>         Tcl_CreateThreadExitHandler arranges for proc to be invoked by
>         Tcl_FinalizeThread and Tcl_ExitThread.
> 
> And those aren't called anywhere that I can see...
> 
> Am I missing something?
> 

------------------------------------------------------------------------
Ronnie Brunner                               ronnie.brunner@netcetera.ch
Netcetera AG, 8040 Zuerich     phone +41 1 247 79 79 fax +41 1 247 70 75

---------------------------------------------------------------------
To unsubscribe, e-mail: websh-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: websh-dev-help@tcl.apache.org