Tcl Thread Library
Libthread is the standard Tcl thread library developed by Zoran Vasiljevic and provides optional functionality for OpenACS. Threads created by the Tcl thread library are executed in an event loop, which makes it easy to send commands to such threads. xotcl-core provides support for the the thread library and uses it for example for background delivery of large files. Also the chat package uses libthread when it is installed. The xotcl-request-monitor depends on libthread.
The advantage of libthead over NaviServer/AOLserver threads is that the threads created by libthread are waiting in an event loop for incoming requests, which eases some types of applications.
INSTALLATION:
In case, NaviServer was installed via install-ns, one can skip the section installation steps. Also the provided configuration script is already set up correctly for usage. The instruction below is for cases, where install-ns was not used.
1. Get and install libthread:
download libthread e.g. from
https://downloads.sourceforge.net/sourceforge/tcl/thread2.8.2.tar.gz
untar it and go to you platform specific directory (eg. thread2.8.2/unix)
# cd unix # ../configure --enable-threads \ --prefix=/usr/local/ns \ --exec-prefix=/usr/local/ns \ --with-naviserver=/usr/local/ns
use --prefix --exec-prefix --with-naviserver with the path pointing to the directory, where NaviServer is installed.
The setup for AOLserver is similar, but different paths are used.
make make install
You should now have installed libthread2.8.2.so (check for /usr/local/ns/lib/thread*/libthread* )
2) Adjusting the AOLserver/NaviServer configuration file to use libthread
Open the configuration file
- look for modules section: ns_section ns/server/${server}/modules
- add libthread to modules section:
ns_param libthread thread2.8.2/libthread2.8.2.so
restart nsd and check the error log, whether libthread was loaded successfully.