An API that allows easy sharing between C and Tcl code is an
interesting idea, e.g. a filter written in C storing data for a page
written in Tcl.  But that's not what's been implemented.

As it stands, it's possible for C code to call down to Tcl and grab a
global variable, it's impossible to get at the tls data as the tls key
is a private variable in the nsd/tclinit.c file.

One bug with the current implementation is that virtual servers will
stomp on each others data.



On 4/18/06, Vlad Seryakov <[EMAIL PROTECTED]> wrote:
> Not you exactly but both of you and Stephen:-)))
>
> Global Tcl vars is more cleaner Tcl-only solution but i agree
> interoperability between C and Tcl using ns-tls would be a good feature.
> Internally ns_tls keeps Ns_set, so getting this from C would be just
> gettting pointer to Ns_Set structure. It just requires more C-level
> calls something like Ns_GetTclTls()/Ns_SetTclTcls()
>
> Zoran Vasiljevic wrote:
> >
> > On 18.04.2006, at 15:52, Vlad Seryakov wrote:
> >
> >> You convinced me that at this moment ns_tls is not appropriate, i will
> >> remove it
> >
> > Oh?! How did I do that? Apart from giving a trivial
> > alternative, I think that this interface is ok per-se.
> > It allows "unified" access from Tcl and C code.
> > That is, one should be able to do the "same" from C
> > and Tcl. Isn't it so?
> >
> > Cheers
> > Zoran

Reply via email to