blob: dbf612ba2d926b21df318559d51073d6c8c35686 [file] [log] [blame]
Brian Paulbe8dd3e1999-04-10 12:25:26 +00001
2NOTE: this information is obsolete for Mesa 3.1. Due to the big
3changes in the Mesa code, the threads support is out of date.
4Someone will have to review/update it.
5
6
7Mesa Threads README
8-------------------
9
10Mesa 2.6 is the starting point for an effort to make Mesa
11safe in multithreaded applications. The files src/mthreads.c and
12src/mthreads.h provide a platform independent threads API which Mesa
13uses internally to provide thread-safe operation. At present the mthreads
14code supports three thread APIS:
15 1) POSIX threads (aka pthreads).
16 2) Solaris / Unix International threads.
17 3) Win32 threads (Win 95/NT).
18
19Here's the current list of targets which enable multithreaded handling
20in Mesa:
21
22 linux-386-pthread for Linux w/ Intel assembly and linuxthreads
23 sunos5-thread for Suns with SunOS 5.x, using Solaris threads
24 sunos5-pthread for Suns with SunOS 5.[56] using POSIX threads
25 sunos5-gcc-thread for Suns with SunOS 5.x and GCC, using Solaris threads
26 sunos5-gcc-pthread for Suns with SunOS 5.[56] and GCC, using POSIX threads
27
28In order to use Mesa with a multithreaded application, Mesa must be compiled
29using one of the thread-enabled configurations. In cases where a platform
30supports multiple APIs which are acceptable to Mesa, Mesa must be built
31with the same threads API as the application in order for things to work
32properly. For example, Solaris >= 2.5 support both POSIX threads and
33Sun's own threads API. In order to guarantee proper operation, it is
34necessary for both Mesa and application code to use the same threads API.
35So, if your application uses Sun's thread API, then you should build Mesa
36using one of the targets for Sun threads.
37
38Since this effort is still very much a work in progress, not all
39aspects of Mesa are thread safe. As of this release (Mesa 2.6) only the
40osmesa drivers have been made MT-safe. As work continues, other drivers
41such as the X11 drivers will also incorporate MT-safe features.
42
43The mtdemos directory contains some example programs which use
44multiple threads to render to osmesa rendering context(s).
45
46Linux users should be aware that there exist many different POSIX
47threads packages. The best solution is the linuxthreads package
48(http://pauillac.inria.fr/~xleroy/linuxthreads/) as this package is the
49only one that really supports multiprocessor machines (AFAIK). See
50http://pauillac.inria.fr/~xleroy/linuxthreads/README for further
51information about the usage of linuxthreads.
52
53If you are interested in helping develop MT-safe Mesa, please send email
54to j.stone@acm.org and poliwoda@volumegraphics.com who are the two most
55directly involved in this effort currently. Similarly, if you have problems
56using the MT-safe builds of Mesa, please send us comments/bugs etc.
57
58Future versions of Mesa will include more extensive documentation related
59to multithreading. This is the first release of our work, so please bear
60with us.
61
62Regards,
63 John Stone -- j.stone@acm.org johns@cs.umr.edu
64 Christoph Poliwoda -- poliwoda@volumegraphics.com
65
66