From: Terrance S. <ts...@us...> - 2007-06-26 17:05:45
|
Update of /cvsroot/xsb/XSB/syslib In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv1041 Modified Files: curr_sym.P curr_sym.xwam thread.P thread.xwam Log Message: Changes to allow default values for thread create in xsb flags. Index: curr_sym.P =================================================================== RCS file: /cvsroot/xsb/XSB/syslib/curr_sym.P,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- curr_sym.P 1 Jun 2007 22:52:39 -0000 1.36 +++ curr_sym.P 26 Jun 2007 17:05:42 -0000 1.37 @@ -722,6 +722,14 @@ (ActionFlag == ABOLISH_TABLES_TRANSITIVELY -> Action = abolish_tables_transitively ; Action = abolish_tables_singly). +xsb_flag(thread_pdlsize, Size) :- + stat_flag(THREAD_PDLSIZE, Size). +xsb_flag(thread_glsize, Size) :- + stat_flag(THREAD_GLSIZE, Size). +xsb_flag(thread_tcpsize, Size) :- + stat_flag(THREAD_TCPSIZE, Size). +xsb_flag(thread_complsize, Size) :- + stat_flag(THREAD_COMPLSIZE, Size). set_xsb_flag(Type,Val):- check_nonvar(Type,set_xsb_flag/2,1), @@ -807,7 +815,7 @@ ; domain_error([0,1],ExamineYN,set_xsb_flag/2,2, 'examine_data clause') ). -set_xsb_flag_1(table_gc_action, Action) :- +set_xsb_flag_1(table_gc_action, Action) :- !, (Action = abolish_tables_transitively -> stat_set_flag(TABLE_GC_ACTION, ABOLISH_TABLES_TRANSITIVELY) ; (Action = abolish_tables_singly -> @@ -815,6 +823,14 @@ ; domain_error([abolish_tables_transitively, abolish_tables_singly],Action,set_xsb_flag/2,2, 'table_gc_action clause') ) ). +set_xsb_flag_1(thread_pdlsize, Size) :-!, + stat_set_flag(THREAD_PDLSIZE, Size). +set_xsb_flag_1(thread_glsize, Size) :-!, + stat_set_flag(THREAD_GLSIZE, Size). +set_xsb_flag_1(thread_tcpsize, Size) :-!, + stat_set_flag(THREAD_TCPSIZE, Size). +set_xsb_flag_1(thread_complsize, Size) :-!, + stat_set_flag(THREAD_COMPLSIZE, Size). set_xsb_flag_1(Type, _) :- domain_error(xsb_flag,Type,set_xsb_flag/2,2). Index: curr_sym.xwam =================================================================== RCS file: /cvsroot/xsb/XSB/syslib/curr_sym.xwam,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 Binary files /tmp/cvsKVh0Nn and /tmp/cvsY1HIaU differ Index: thread.P =================================================================== RCS file: /cvsroot/xsb/XSB/syslib/thread.P,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- thread.P 24 Jun 2007 18:55:54 -0000 1.18 +++ thread.P 26 Jun 2007 17:05:42 -0000 1.19 @@ -39,7 +39,7 @@ (Alias == [] -> Aliased = 0 ; Aliased = 1), - thread_request( XSB_THREAD_CREATE, Goal, ThreadId, + thread_request( XSB_THREAD_CREATE_PARAMS, Goal, ThreadId, GLSize,TCSize,ComplSize,PDLSize,Detached,Aliased), (Aliased == 1 -> add_aliases(Alias,THREAD_ALIAS,ThreadId,thread_create/3) ; true). @@ -55,12 +55,12 @@ (var(Detached) -> Detached = 0 ; true). check_options_list_1([Option|Rest],GLSize,TCSize,ComplSize,PDLSize,Detached,Alias):- !, check_nonvar(Option,thread_create/3,3), - (Option @= glsize(_) -> Option = glsize(N),set_thread_create_arg(N,GLSize,glsize) - ; (Option @= tcsize(_) -> Option = tcsize(N),set_thread_create_arg(N,TCSize,tcsize) - ; (Option @= complsize(_) -> Option = complsize(N),set_thread_create_arg(N,ComplSize,complsize) - ; (Option @= pdlsize(_) -> Option = pdlsize(N),set_thread_create_arg(N,PDLSize,pdlsize) - ; (Option @= detached(Boolean) -> - (Boolean == true -> Detached = 1 ; Detached = 0) + (Option @= glsize(_) -> Option = glsize(N),set_thread_create_arg(N,GLSize,glsize), Alias = R + ; (Option @= tcsize(_) -> Option = tcpsize(N),set_thread_create_arg(N,TCSize,tcsize), Alias = R + ; (Option @= complsize(_) -> Option = complsize(N),set_thread_create_arg(N,ComplSize,complsize), Alias = R + ; (Option @= pdlsize(_) -> Option = pdlsize(N),set_thread_create_arg(N,PDLSize,pdlsize), Alias = R + ; (Option @= detached(_) -> + (Option = detached(Boolean),Boolean == true -> Detached = 1 ; Detached = 0),Alias = R ; (Option @= alias(_) -> Option = alias(A),check_atom(A,thread_create/3,3),Alias = [A|R] ; domain_error(thread_option,Option,thread_create/3,3,'') ) ) ) ) ) ), @@ -79,7 +79,7 @@ thread_create( Goal, ThreadId ) :- % check_callable(Goal,thread_create/2,1), % check_var(ThreadId,thread_create/2,2), - thread_request( XSB_THREAD_CREATE, Goal, ThreadId, 0,0,0,1,0,0). + thread_request( XSB_THREAD_CREATE_FLAGS, Goal, ThreadId, 0,0,0,0,0,0). /*---------------*/ Index: thread.xwam =================================================================== RCS file: /cvsroot/xsb/XSB/syslib/thread.xwam,v retrieving revision 1.34 retrieving revision 1.35 diff -u -r1.34 -r1.35 Binary files /tmp/cvsSL2LXw and /tmp/cvswqtJz3 differ |