git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1973 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
		
			
				
	
	
		
			37 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			1.5 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| ================================================================
 | |
| Logtalk - Open source object-oriented logic programming language
 | |
| Release 2.30.7
 | |
| 
 | |
| Copyright (c) 1998-2007 Paulo Moura.  All Rights Reserved.
 | |
| ================================================================
 | |
| 
 | |
| 
 | |
| To load this example and for sample queries, please see the SCRIPT file.
 | |
| 
 | |
| This folder contains a multi-threading implementation of the merge sort 
 | |
| algorithm.  Depending on the size of the lists that are ordered, using 
 | |
| only one thread can be faster. The number of threads to be use in sorting 
 | |
| is set using the msort/1 object parameter. You may need to adjust the 
 | |
| size of the memory areas used by your Prolog compiler, depending on the 
 | |
| size of the lists you want to sort.
 | |
| 
 | |
| This example uses a simple implementation of the merge sort algorithm,
 | |
| intended only to illustrate Logtalk multi-threading features. For any 
 | |
| other purpose, you may find the following paper a worthwhile reading:
 | |
| 
 | |
| @incollection{ apt93modular,
 | |
|     author = "Krzysztof R. Apt and Dino Pedreschi",
 | |
|     title = "Modular Termination Proofs for Logic and Pure Prolog Programs.",
 | |
|     booktitle = "116",
 | |
|     month = "31",
 | |
|     publisher = "Centrum voor Wiskunde en Informatica (CWI)",
 | |
|     address = "ISSN 0169-118X",
 | |
|     pages = "35",
 | |
|     year = "1993",
 | |
|     url = "citeseer.ist.psu.edu/apt93modular.html" }
 | |
| 
 | |
| You probably want to play with the list sizes in order to find out when the 
 | |
| lists to be sorted are big enough to make the use of multi-threading worth
 | |
| performance-wise (i.e. to compensate the overhead of thread creation and 
 | |
| management).
 |