Changeset 4451 for trunk/compiler

Show
Ignore:
Timestamp:
08/29/08 09:47:12 (4 months ago)
Author:
pmoura
Message:

Small performance improvement to the built-in multi-threading predicates threaded_exit/1-2.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/compiler/logtalk.pl

    r4450 r4451  
    1329113291        % answering thread exists; go ahead and retrieve the solution(s): 
    1329213292        thread_get_message(Queue, '$lgt_thread_id'(Type, Goal, This, Self, Tag, Id)), 
    13293         call_cleanup( 
    13294             '$lgt_mt_get_reply_aux'(Type, Queue, Goal, This, Self, Tag, Id), 
    13295             (   Type == non_deterministic -> 
    13296                 (   thread_property(Id, status(running)) ->                 % if the thread is still running, it's suspended waiting 
     13293        (   Type == deterministic -> 
     13294            '$lgt_mt_det_reply'(Queue, Goal, This, Self, Tag, Id)           % detached thread 
     13295        ;   call_cleanup( 
     13296                '$lgt_mt_non_det_reply'(Queue, Goal, This, Self, Tag, Id), 
     13297                ((  thread_property(Id, status(running)) ->                 % if the thread is still running, it's suspended waiting 
    1329713298                    catch(thread_send_message(Id, '$lgt_exit'), _, true)    % for a request to an alternative proof; tell it to exit 
    13298                 ;   true 
    13299                 ), 
    13300                 thread_join(Id, _) 
    13301             ;   true 
     13299                 ;  true 
     13300                 ), 
     13301                 thread_join(Id, _)) 
    1330213302            ) 
    1330313303        ) 
     
    1330513305        throw(error(existence_error(goal_thread, Goal), Sender)) 
    1330613306    ). 
    13307  
    13308  
    13309 '$lgt_mt_get_reply_aux'(deterministic, Queue, Goal, This, Self, Tag, Id) :- 
    13310     '$lgt_mt_det_reply'(Queue, Goal, This, Self, Tag, Id). 
    13311  
    13312 '$lgt_mt_get_reply_aux'(non_deterministic, Queue, Goal, This, Self, Tag, Id) :- 
    13313     '$lgt_mt_non_det_reply'(Queue, Goal, This, Self, Tag, Id). 
    1331413307 
    1331513308