separate MAX_WORKERS and MAX_THREADS (obs from Paulo Moura)

MAX_AGENTS can be used in all cases


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2189 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc
2008-04-02 15:41:50 +00:00
parent 7aab33a153
commit 70b3438293
8 changed files with 3310 additions and 1037 deletions

View File

@@ -10,7 +10,7 @@
* File: Heap.h *
* mods: *
* comments: Heap Init Structure *
* version: $Id: Heap.h,v 1.128 2008-04-01 22:28:41 vsc Exp $ *
* version: $Id: Heap.h,v 1.129 2008-04-02 15:41:50 vsc Exp $ *
*************************************************************************/
/* information that can be stored in Code Space */
@@ -98,7 +98,7 @@ typedef struct restore_info {
} restoreinfo;
#if defined(THREADS)
extern struct restore_info rinfo[MAX_WORKERS];
extern struct restore_info rinfo[MAX_THREADS];
#else
extern struct restore_info rinfo;
#endif
@@ -224,7 +224,7 @@ typedef struct various_codes {
#if defined(YAPOR) || defined(THREADS)
lockvar bgl; /* protect long critical regions */
lockvar free_blocks_lock; /* protect the list of free blocks */
worker_local wl[MAX_WORKERS];
worker_local wl[MAX_AGENTS];
#else
worker_local wl;
#endif
@@ -564,7 +564,7 @@ typedef struct various_codes {
#endif /* YAPOR || TABLING */
#ifdef THREADS
lockvar thread_handles_lock; /* protect ThreadManipulation */
struct thandle thread_handle[MAX_WORKERS];
struct thandle thread_handle[MAX_THREADS];
#endif
UInt n_of_atoms;
UInt atom_hash_table_size;

10
H/Yap.h
View File

@@ -10,7 +10,7 @@
* File: Yap.h.m4 *
* mods: *
* comments: main header file for YAP *
* version: $Id: Yap.h,v 1.31 2008-03-27 00:41:32 vsc Exp $ *
* version: $Id: Yap.h,v 1.32 2008-04-02 15:41:50 vsc Exp $ *
*************************************************************************/
#include "config.h"
@@ -388,6 +388,12 @@ typedef pthread_rwlock_t rwlock_t;
#ifdef __alpha
#include <alpha_locks_funcs.h>
#endif
#ifdef YAPOR
#define MAX_AGENTS MAX_WORKERS
#endif
#ifdef THREADS
#define MAX_AGENTS MAX_THREADS
#endif
#endif
/************ variables concerned with Error Handling *************/
@@ -730,7 +736,7 @@ typedef struct thread_globs
} tglobs;
extern struct thread_globs Yap_thread_gl[MAX_WORKERS];
extern struct thread_globs Yap_thread_gl[MAX_THREADS];
#define Yap_LocalBase Yap_thread_gl[worker_id].local_base