DepFr_cons field initialization for threads
This commit is contained in:
parent
3345709bdb
commit
efc59cf8d6
@ -3225,7 +3225,7 @@ compact_heap( USES_REGS1 )
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
if (depfr != NULL && gc_B >= DepFr_cons_cp(depfr)) {
|
if (depfr && gc_B >= DepFr_cons_cp(depfr)) {
|
||||||
gc_B = DepFr_cons_cp(depfr);
|
gc_B = DepFr_cons_cp(depfr);
|
||||||
depfr = DepFr_next(depfr);
|
depfr = DepFr_next(depfr);
|
||||||
}
|
}
|
||||||
@ -3408,7 +3408,7 @@ icompact_heap( USES_REGS1 )
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
if (depfr != NULL && gc_B >= DepFr_cons_cp(depfr)) {
|
if (depfr && gc_B >= DepFr_cons_cp(depfr)) {
|
||||||
gc_B = DepFr_cons_cp(depfr);
|
gc_B = DepFr_cons_cp(depfr);
|
||||||
depfr = DepFr_next(depfr);
|
depfr = DepFr_next(depfr);
|
||||||
}
|
}
|
||||||
|
@ -191,6 +191,9 @@ setup_engine(int myworker_id, int init_thread)
|
|||||||
GLOBAL_NOfThreadsCreated++;
|
GLOBAL_NOfThreadsCreated++;
|
||||||
DEBUG_TLOCK_ACCESS(2, myworker_id);
|
DEBUG_TLOCK_ACCESS(2, myworker_id);
|
||||||
pthread_mutex_unlock(&(REMOTE_ThreadHandle(myworker_id).tlock));
|
pthread_mutex_unlock(&(REMOTE_ThreadHandle(myworker_id).tlock));
|
||||||
|
#ifdef TABLING
|
||||||
|
DepFr_cons_cp(LOCAL_top_dep_fr) = B; /* same as in Yap_init_root_frames() */
|
||||||
|
#endif /* TABLING */
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -140,7 +140,9 @@ void Yap_init_global_optyap_data(int max_table_size, int n_workers, int sch_loop
|
|||||||
GLOBAL_last_sg_fr = NULL;
|
GLOBAL_last_sg_fr = NULL;
|
||||||
GLOBAL_check_sg_fr = NULL;
|
GLOBAL_check_sg_fr = NULL;
|
||||||
#endif /* LIMIT_TABLING */
|
#endif /* LIMIT_TABLING */
|
||||||
|
#ifdef YAPOR
|
||||||
new_dependency_frame(GLOBAL_root_dep_fr, FALSE, NULL, NULL, NULL, NULL, NULL);
|
new_dependency_frame(GLOBAL_root_dep_fr, FALSE, NULL, NULL, NULL, NULL, NULL);
|
||||||
|
#endif /* YAPOR */
|
||||||
for (i = 0; i < MAX_TABLE_VARS; i++) {
|
for (i = 0; i < MAX_TABLE_VARS; i++) {
|
||||||
CELL *pt = GLOBAL_table_var_enumerator_addr(i);
|
CELL *pt = GLOBAL_table_var_enumerator_addr(i);
|
||||||
RESET_VARIABLE(pt);
|
RESET_VARIABLE(pt);
|
||||||
@ -175,10 +177,12 @@ void Yap_init_local_optyap_data(int wid) {
|
|||||||
/* local data related to tabling */
|
/* local data related to tabling */
|
||||||
REMOTE_next_free_ans_node(wid) = NULL;
|
REMOTE_next_free_ans_node(wid) = NULL;
|
||||||
REMOTE_top_sg_fr(wid) = NULL;
|
REMOTE_top_sg_fr(wid) = NULL;
|
||||||
REMOTE_top_dep_fr(wid) = GLOBAL_root_dep_fr;
|
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
|
REMOTE_top_dep_fr(wid) = GLOBAL_root_dep_fr;
|
||||||
Set_REMOTE_top_cp_on_stack(wid, (choiceptr) LOCAL_LocalBase); /* ??? */
|
Set_REMOTE_top_cp_on_stack(wid, (choiceptr) LOCAL_LocalBase); /* ??? */
|
||||||
REMOTE_top_susp_or_fr(wid) = GLOBAL_root_or_fr;
|
REMOTE_top_susp_or_fr(wid) = GLOBAL_root_or_fr;
|
||||||
|
#else
|
||||||
|
new_dependency_frame(REMOTE_top_dep_fr(wid), FALSE, NULL, NULL, NULL, NULL, NULL);
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
#endif /* TABLING */
|
#endif /* TABLING */
|
||||||
return;
|
return;
|
||||||
@ -214,7 +218,11 @@ void Yap_init_root_frames(void) {
|
|||||||
|
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
/* root dependency frame */
|
/* root dependency frame */
|
||||||
|
#ifdef YAPOR
|
||||||
DepFr_cons_cp(GLOBAL_root_dep_fr) = B;
|
DepFr_cons_cp(GLOBAL_root_dep_fr) = B;
|
||||||
|
#else
|
||||||
|
DepFr_cons_cp(LOCAL_top_dep_fr) = B;
|
||||||
|
#endif /* YAPOR */
|
||||||
#endif /* TABLING */
|
#endif /* TABLING */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +209,9 @@ struct global_optyap_data {
|
|||||||
struct subgoal_frame *last_subgoal_frame;
|
struct subgoal_frame *last_subgoal_frame;
|
||||||
struct subgoal_frame *check_subgoal_frame;
|
struct subgoal_frame *check_subgoal_frame;
|
||||||
#endif /* LIMIT_TABLING */
|
#endif /* LIMIT_TABLING */
|
||||||
|
#ifdef YAPOR
|
||||||
struct dependency_frame *root_dependency_frame;
|
struct dependency_frame *root_dependency_frame;
|
||||||
|
#endif /* YAPOR */
|
||||||
CELL table_var_enumerator[MAX_TABLE_VARS];
|
CELL table_var_enumerator[MAX_TABLE_VARS];
|
||||||
#ifdef TABLE_LOCK_AT_WRITE_LEVEL
|
#ifdef TABLE_LOCK_AT_WRITE_LEVEL
|
||||||
lockvar table_lock[TABLE_LOCK_BUCKETS];
|
lockvar table_lock[TABLE_LOCK_BUCKETS];
|
||||||
|
Reference in New Issue
Block a user