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