thread_defs_xsb.h

00001 /* File:      thread_defs_xsb.h
00002 ** Author(s): Marques
00003 ** Contact:   xsb-contact@cs.sunysb.edu
00004 ** 
00005 ** Copyright (C) The Research Foundation of SUNY, 1986, 1993-1998
00006 ** 
00007 ** XSB is free software; you can redistribute it and/or modify it under the
00008 ** terms of the GNU Library General Public License as published by the Free
00009 ** Software Foundation; either version 2 of the License, or (at your option)
00010 ** any later version.
00011 ** 
00012 ** XSB is distributed in the hope that it will be useful, but WITHOUT ANY
00013 ** WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00014 ** FOR A PARTICULAR PURPOSE.  See the GNU Library General Public License for
00015 ** more details.
00016 ** 
00017 ** You should have received a copy of the GNU Library General Public License
00018 ** along with XSB; if not, write to the Free Software Foundation,
00019 ** Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00020 **
00021 */
00022 
00023 
00024 #ifndef __THREAD_DEFS_XSB_H__
00025 
00026 #define __THREAD_DEFS_XSB_H__
00027 
00028  
00029 /* THREAD PRIMITIVES */
00030 
00031 #define XSB_THREAD_CREATE        1
00032 #define XSB_THREAD_EXIT          2
00033 #define XSB_THREAD_JOIN          3
00034 #define XSB_THREAD_DETACH        4
00035 #define XSB_THREAD_SELF          5
00036 
00037 #define XSB_MUTEX_INIT           6
00038 #define XSB_MUTEX_LOCK           7
00039 #define XSB_MUTEX_TRYLOCK        8
00040 #define XSB_MUTEX_UNLOCK         9
00041 #define XSB_MUTEX_DESTROY       10
00042 
00043 #define XSB_SYS_MUTEX_LOCK      11
00044 #define XSB_SYS_MUTEX_UNLOCK    12
00045 
00046 #define XSB_ENSURE_ONE_THREAD   13
00047 #define XSB_THREAD_YIELD        14
00048 
00049 #define XSB_SHOW_MUTEXES        15
00050 
00051 #define XSB_SET_INIT_GLSTACK_SIZE       16
00052 #define XSB_SET_INIT_TCPSTACK_SIZE      17
00053 #define XSB_SET_INIT_PDL_SIZE           18 
00054 #define XSB_SET_INIT_COMPLSTACK_SIZE    19
00055 
00056 #define XSB_THREAD_PROPERTY             20
00057 #define XSB_THREAD_INTERRUPT             21
00058 
00059 #define ABOLISH_PRIVATE_TABLES        22
00060 #define ABOLISH_SHARED_TABLES        23
00061 
00062 #define MAX_THREADS             1024
00063 
00064 
00065 /* MUTEX KINDS (under LINUX) */
00066 
00067 #define XSB_FAST_MUTEX          1
00068 #define XSB_RECURSIVE_MUTEX     2
00069 #define XSB_ERRORCHECK_MUTEX    3
00070 
00071 
00072 
00073 /* Mutexes to protect execution of critical system stuff */
00074 
00075 #define MAX_SYS_MUTEXES         40
00076 
00077 /* Be sure to update this if you add a recusive mutex */
00078 #define LAST_REC_MUTEX          8
00079 
00080 /* If you add a mutex, also update mutex_names[] in thread_xsb.c */
00081 /* first mutexes are recursive */
00082 
00083 /* Handles various data structures for dynamic code, including
00084    dispatch blocks. */
00085 #define MUTEX_DYNAMIC           0
00086 
00087 /* Use this one only for the stream_table itself: see I/O code for 
00088    locking the streams themselves. */
00089 #define MUTEX_IO                1       /* Must be recursive */
00090 
00091 /* MUTEX_TABLE handles global table data structures: lists of tifs,
00092    dispatch blocks, table dispatch blocks, and
00093    deleted_table_info_frames. */
00094 
00095 #define MUTEX_TABLE             2
00096 #define MUTEX_TRIE              3
00097 #define MUTEX_SYMBOL            4
00098 #define MUTEX_FLAGS             5
00099 #define MUTEX_LOAD_UNDEF        6       /* Must be recursive */
00100 #define MUTEX_DELAY             7
00101 #define MUTEX_SYS_SYSTEM        8      /* recursive prob. not necess */
00102 
00103 /* Non-recursive */
00104 #define MUTEX_STRING            15
00105 #define MUTEX_ATOM_BUF          16
00106 #define MUTEX_SM                17
00107 #define MUTEX_STACKS            18
00108 #define MUTEX_SOCKETS           19
00109 #define MUTEX_MEM               20
00110 #define MUTEX_ODBC              21
00111 #define MUTEX_GENTAG            22
00112 /* probably obsolete */
00113 #define MUTEX_DISPBLKHDR        23
00114 
00115 /* Some mutexes available to users */
00116 #define MUTEX_CONSOLE           30
00117 #define MUTEX_USER1             31
00118 #define MUTEX_USER2             32
00119 #define MUTEX_USER3             33
00120 #define MUTEX_USER4             34
00121 #define MUTEX_USER5             35
00122 #define MUTEX_USER6             36
00123 #define MUTEX_USER7             37
00124 #define MUTEX_USER8             38
00125 #define MUTEX_USER9             39
00126 
00127 /* Used for random number generation in testing modules */
00128 
00129 #define INIT_MT_RANDOM          0
00130 #define MT_RANDOM               1
00131 #define MT_RANDOM_INTERVAL      2
00132 
00133 #endif /* __THREAD_DEFS_XSB_H__ */

Generated on Wed Jul 26 13:30:42 2006 for XSB by  doxygen 1.4.5