Brian Paul | be8dd3e | 1999-04-10 12:25:26 +0000 | [diff] [blame] | 1 | |
Brian Paul | be8dd3e | 1999-04-10 12:25:26 +0000 | [diff] [blame] | 2 | |
| 3 | Mesa Threads README |
| 4 | ------------------- |
| 5 | |
Brian Paul | 26651d0 | 1999-12-17 15:25:14 +0000 | [diff] [blame] | 6 | Thread safety was introduced in Mesa 2.6 by John Stone and |
| 7 | Christoph Poliwoda. |
| 8 | |
| 9 | It was redesigned in Mesa 3.3 so that thread safety is |
| 10 | supported by default (on systems which support threads, |
| 11 | that is). There is no measurable penalty on single |
| 12 | threaded applications. |
| 13 | |
| 14 | NOTE that the only _driver_ which is thread safe at this time |
| 15 | is the OS/Mesa driver! |
| 16 | |
| 17 | |
| 18 | At present the mthreads code supports three thread APIS: |
Brian Paul | be8dd3e | 1999-04-10 12:25:26 +0000 | [diff] [blame] | 19 | 1) POSIX threads (aka pthreads). |
| 20 | 2) Solaris / Unix International threads. |
| 21 | 3) Win32 threads (Win 95/NT). |
| 22 | |
Brian Paul | 26651d0 | 1999-12-17 15:25:14 +0000 | [diff] [blame] | 23 | Support for other thread libraries can be added src/glthread.[ch] |
Brian Paul | be8dd3e | 1999-04-10 12:25:26 +0000 | [diff] [blame] | 24 | |
Brian Paul | be8dd3e | 1999-04-10 12:25:26 +0000 | [diff] [blame] | 25 | |
Brian Paul | 26651d0 | 1999-12-17 15:25:14 +0000 | [diff] [blame] | 26 | In order to guarantee proper operation, it is |
Brian Paul | be8dd3e | 1999-04-10 12:25:26 +0000 | [diff] [blame] | 27 | necessary for both Mesa and application code to use the same threads API. |
| 28 | So, if your application uses Sun's thread API, then you should build Mesa |
| 29 | using one of the targets for Sun threads. |
| 30 | |
Brian Paul | be8dd3e | 1999-04-10 12:25:26 +0000 | [diff] [blame] | 31 | The mtdemos directory contains some example programs which use |
| 32 | multiple threads to render to osmesa rendering context(s). |
| 33 | |
| 34 | Linux users should be aware that there exist many different POSIX |
| 35 | threads packages. The best solution is the linuxthreads package |
| 36 | (http://pauillac.inria.fr/~xleroy/linuxthreads/) as this package is the |
| 37 | only one that really supports multiprocessor machines (AFAIK). See |
| 38 | http://pauillac.inria.fr/~xleroy/linuxthreads/README for further |
| 39 | information about the usage of linuxthreads. |
| 40 | |
Brian Paul | 26651d0 | 1999-12-17 15:25:14 +0000 | [diff] [blame] | 41 | If you are interested in helping with thread safety work in Mesa |
| 42 | join the Mesa developers mailing list and post your proposal. |
Brian Paul | be8dd3e | 1999-04-10 12:25:26 +0000 | [diff] [blame] | 43 | |
Brian Paul | be8dd3e | 1999-04-10 12:25:26 +0000 | [diff] [blame] | 44 | |
| 45 | Regards, |
| 46 | John Stone -- j.stone@acm.org johns@cs.umr.edu |
| 47 | Christoph Poliwoda -- poliwoda@volumegraphics.com |
| 48 | |
| 49 | |
Brian Paul | 26651d0 | 1999-12-17 15:25:14 +0000 | [diff] [blame] | 50 | Version info: |
| 51 | Mesa 2.6 - initial thread support. |
| 52 | Mesa 3.3 - thread support mostly rewritten (Brian Paul) |