This section describes some of the issues involved in using MIT-pthreads.
On Linux, you should not use MIT-pthreads. Use the installed LinuxThreads implementation instead. See Section 2.13.1, “Linux Notes”.
If your system does not provide native thread support, you should build MySQL using the MIT-pthreads package. This includes older FreeBSD systems, SunOS 4.x, Solaris 2.4 and earlier, and some others. See Section 2.1.1, “Operating Systems Supported by MySQL Community Server”.
MIT-pthreads is not part of the MySQL 5.4 source distribution. If you require this package, you need to download it separately from http://dev.mysql.com/Downloads/Contrib/pthreads-1_60_beta6-mysql.tar.gz
After downloading, extract this source archive into the top
level of the MySQL source directory. It creates a new
On most systems, you can force MIT-pthreads to be used by
running configure with the
Building in a nonsource directory is not supported when using MIT-pthreads because we want to minimize our changes to this code.
The checks that determine whether to use MIT-pthreads occur
only during the part of the configuration process that deals
with the server code. If you have configured the
--without-server to build
only the client code, clients do not know whether
MIT-pthreads is being used and use Unix socket file
connections by default. Because Unix socket files do not
work under MIT-pthreads on some platforms, this means you
need to use
with a value other than
you run client programs.
When MySQL is compiled using MIT-pthreads, system locking is
disabled by default for performance reasons. You can tell
the server to use system locking with the
This is needed only if you want to be able to run two MySQL
servers against the same data files, but that is not
Sometimes the pthread
fails to bind to a socket without any error message (at
least on Solaris). The result is that all connections to the
server fail. For example:
mysqladmin versionmysqladmin: connect to server at '' failed; error: 'Can't connect to mysql server on localhost (146)'
The solution to this problem is to kill the mysqld server and restart it. This has happened to us only when we have forcibly stopped the server and restarted it immediately.
With MIT-pthreads, the
call isn't interruptible with
(break). This is noticeable only when you run
mysqladmin --sleep. You must wait for the
sleep() call to terminate before the
interrupt is served and the process stops.
When linking, you might receive warning messages like these (at least on Solaris); they can be ignored:
ld: warning: symbol `_iob' has differing sizes: (file /my/local/pthreads/lib/libpthread.a(findfp.o) value=0x4; file /usr/lib/libc.so value=0x140); /my/local/pthreads/lib/libpthread.a(findfp.o) definition taken ld: warning: symbol `__iob' has differing sizes: (file /my/local/pthreads/lib/libpthread.a(findfp.o) value=0x4; file /usr/lib/libc.so value=0x140); /my/local/pthreads/lib/libpthread.a(findfp.o) definition taken
Some other warnings also can be ignored:
implicit declaration of function `int strtoll(...)' implicit declaration of function `int strtoul(...)'
We have not been able to make
work with MIT-pthreads. (This is not necessary, but may be
of interest to some.)