Here is how I solved the problem of loading a plain Tcl module into
AOLserver.  I'd be interested in hearing other approaches.

1. Create AOLserver Tcl Library directory.

   mkdir servers/server1/modules/tcl/pdflib
   cp pdflib_tcl.so.1.1.1 servers/server1/modules/tcl/pdflib

2. Add init.tcl file in directory above with the following line.

   load [ns_info tcllib]/pdflib/pdflib_tcl.so.1.1.1

3. Add Tcl Library to AOLserver config.

   ns_section "ns/server/${servername}/modules"
   ns_param   pdflib          Tcl

Basically something like the above.  Of course this does not address any
threading issues.  And I *believe* this will cause the module to only
get loaded on thread creation, instead of every hit.

Jeremy

On Thu, 2002-03-28 at 20:17, Jeff Rogers wrote:
> I have an app that was running on tclhttpd that I want to migrate to
> AOLserver.  For its small database needs it used mk4tcl
> (http://www.equi4.com/metakit/tcl.html).   So I'm stuck with the problem of
> figuring out how to use mk4tcl within AOLserver.  I realize there may be
> threading issues, its easy enough to take a heavy-handed approach and put a
> mutex around every operation.
>
> I tried putting "load Mk4tcl.so" in a startup tcl file, figuring that any
> changed made to the interpreter at startup would be carried through to ADPs;
> it made the commands available within that file but not in subsequent requests.
>
> putting "load Mk4tcl.so" in every page seems to work, but it also seems like
> overkill.
>
> There is no ns_mk4tcl that I'm aware of, tho it probably wouldn't be
> difficult to write such.  Barring that (say I only had a loadable module and
> no source) would it be possible to write a ns_load_module module that would
> load something with the plain tcl module interface into aolserver?
>
> -J
>

Reply via email to