Re: [tcljava-dev] aolserver support patch
Brought to you by:
mdejong
|
From: Daniel W. <da...@rt...> - 2001-01-29 17:51:00
|
>>>>> "Mo" == Mo DeJong <md...@cy...> writes:
Mo> On Sat, 6 Jan 2001, Dan Wickstrom wrote:
>> Mo,
>>
>> I would like to apply the attached patch to the tclblend source
>> to add support for aolserver. Let me know if it's ok.
>>
>> -Dan
Mo> In looking at this patch, I am a bit bothered by the fact that
Mo> you moved the ThreadSpecificData struct from javaCmd.c to
Mo> java.h. I was under the impression that Tcl needed to have
Mo> this struct defined only in the .c file and not the .h
Mo> file. This is so that it can be defined as different ways for
Mo> different files. It seems you worked around this merging the
Mo> TSD data, but I am not sure that it really "right". Will it
Mo> break some other code that might need to #include java.h?
Typically the TSD (thread-specific-data) structure is limited to
"file" scope. That way you can have multiple TSD structures
(one-per-file) that are isolated from each other. I have taken the
two TSD structures that previously existed and combined them into a
single TSD structure which is accessible with global scope throughout
the tclblend sources. If you included java.h in a file that already
had its own TSD structure defined, then there would be a problem. The
way I have it setup now, you would need to add new variables to the
existing TSD structure rather than creating a separate TSD structure
as I did when I modified the notifier to be multi-threaded.
Mo> I am not sure exactly what you want to do with the data ptr
Mo> returned by JavaGetDataKey, can it be cast to a void * so that
Mo> code outside of javaCmd.c does not need to know the type of
Mo> the TSD ptr?
I use JavaGetDataKey to get the TSD data key when I'm accessing the
TSD structure from the aolserver specific code. Yes, I should be able
to change it to return a void pointer.
Mo> Also, why do you not call Interp.dispose() when compiled with
Mo> -DWITH_AOLSERVER ? A comment about why that bit was compiled
Mo> out might be good. I assume it has something to do with this
Mo> do_cleanup flag. I am a little fuzzy on what that is needed
Mo> for.
Mo> Also, why did you change the calls in JavaInterpDeleted?
Aolserver disposes of the interpreter automatically, so it is not
necessary to explicitly dispose of the interpreter in aolserver.
Having the dispose call caused the server to crash.
Mo> Does
Mo> adding that tid variable in Java_tcl_lang_Notifier_init and
Mo> Java_tcl_lang_Notifier_alertNotifier get rid of a compiler
Mo> warning or something?
Yes, that was done to get rid of a compiler warning.
|