Galaxy Communicator Documentation:
Thread Notes
The core Galaxy Communicator library is
known to be thread-safe on the following platforms:
-
Sparc Solaris 2.5.1 and above
-
RedHat Linux 6.0 (kernel version 2.2.5, glibc
version 2.1.1)
-
Windows NT (thanks to MIT for making this
work)
The thread implementation in Communicator
uses POSIX threads on Unix, and native NT threads on NT.
On Unix, if you wish to have the option
of compiling a threaded version of a library or executable, insert the
line
THREAD_SAFE = 1
into the MIT Makefile before rules.make is
loaded. This will enable the compilation
targets thread, thread-debug,
thread-profile,
thread-purify and thread-insure.
If THREAD_SAFE has not been set, these targets will be equivalent to the
non-threaded versions. MITRE has provided an (experimental) option for
toplevel server operation which uses threads
instead of timed tasks for server and connection management. As of
version 3.0, this option works on Windows as well as Unix.
On Windows NT, make sure the -D_REENTRANT
flag is in your compilation line.
Due to some backward compatibility issues,
we have let remain a situation in the output code where the variable which
controls verbosity levels may be initialized (harmlessly) more than once.
The Hub is not completely thread-safe,
due to calls to rand() and localtime(). These will be fixed in a subsequent
distribution.
Signals
The Communicator library provides two
functions for signal handling, which are guaranteed to do the right
things in both threaded and non-threaded cases. Please use these functions
to install signal handlers (and to initialize signal handling, if you're
writing your own toplevel loop).
Platform notes
Solaris
The Communicator library uses the following
reentrant versions of functions:
-
gethostbyname_r()
-
strtok_r()
The library also uses a homemade version of
inet_ntoa() due to some unfortunate interactions with Tcl observed by the
MIT folks. inet_ntoa_r() is available in Solaris, but is not documented.
RedHat Linux 6.0
The Communicator library uses the following
reentrant versions of functions:
-
gethostbyname_r()
-
strtok_r()
The library also uses a homemade version of
inet_ntoa() due to some unfortunate interactions with Tcl observed by the
MIT folks. The library also provides a thread-safe version of strerror(),
which appears not to be thread-safe in this version of Linux.
It appears that RedHat 5.2 might also support
a thread-safe compilation of the core library. RedHat 4.2 is pre-glibc
and may not have the appropriate thread support.
Windows NT
The Windows NT functions gethostbyname(),
inet_ntoa() and strtok() are thread-safe. The NT documentation does not
make it clear whether strerror() is thread-safe.
Other platforms
If you enable threads for the core Communicator
compilation and your compilation fails because any of these functions are
missing, the chances are you will not be able to enable threads. Even if
you write a wrapper function with the appropriate mutex protection, you
will not be able to protect the calls in the core Communicator library
and the results will be unsafe behavior. If you need support enabling threads
on a platform not described here, please contact us.
Please send comments and suggestions to:bugs-darpacomm@linus.mitre.org
Last updated October 13, 2000.
Copyright (c) 1999, 2000
The MITRE
Corporation
ALL RIGHTS RESERVED