I agree, the question is: remove it completely or make it better C/Tcl sharing API?

As for static tls key, i would create 2 public functions that return and set TLS data, this way key can still be private.

Also, we run cleanups on connection close, so we can cleanup this data as well.

Stephen Deasey wrote:
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


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=k&kid0944&bid$1720&dat1642
_______________________________________________
naviserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/naviserver-devel


--
Vlad Seryakov
571 262-8608 office
[EMAIL PROTECTED]
http://www.crystalballinc.com/vlad/


Reply via email to