git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1973 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
		
			
				
	
	
		
			69 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			69 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| ================================================================
 | |
| Logtalk - Open source object-oriented logic programming language
 | |
| Release 2.30.7
 | |
| 
 | |
| Copyright (c) 1998-2007 Paulo Moura.  All Rights Reserved.
 | |
| ================================================================
 | |
| 
 | |
| 
 | |
| % start by loading the example and the required library files:
 | |
| 
 | |
| | ?- logtalk_load(buffer(loader)).
 | |
| ...
 | |
| 
 | |
| 
 | |
| % start the producer and the consumer, each one running in its own thread:
 | |
| 
 | |
| | ?- threaded_ignore(producer(2)::run(25)), threaded_ignore(consumer(5)::run(25)).
 | |
| 
 | |
|  produced item 0 (1/7 items in the buffer)
 | |
|  consumed item 0 (0/7 items in the buffer)
 | |
|  produced item 1 (1/7 items in the buffer)
 | |
|  produced item 2 (2/7 items in the buffer)
 | |
|  produced item 3 (3/7 items in the buffer)
 | |
|  produced item 4 (4/7 items in the buffer)
 | |
|  consumed item 1 (3/7 items in the buffer)
 | |
|  produced item 5 (4/7 items in the buffer)
 | |
|  produced item 6 (5/7 items in the buffer)
 | |
|  produced item 7 (6/7 items in the buffer)
 | |
|  consumed item 2 (5/7 items in the buffer)
 | |
|  produced item 8 (6/7 items in the buffer)
 | |
|  consumed item 3 (5/7 items in the buffer)
 | |
|  produced item 9 (6/7 items in the buffer)
 | |
|  consumed item 4 (5/7 items in the buffer)
 | |
|  produced item 10 (6/7 items in the buffer)
 | |
|  consumed item 5 (5/7 items in the buffer)
 | |
|  produced item 11 (6/7 items in the buffer)
 | |
|  produced item 12 (7/7 items in the buffer)
 | |
|  consumed item 6 (6/7 items in the buffer)
 | |
|  produced item 13 (7/7 items in the buffer)
 | |
|  consumed item 7 (6/7 items in the buffer)
 | |
|  produced item 14 (7/7 items in the buffer)
 | |
|  consumed item 8 (6/7 items in the buffer)
 | |
|  produced item 15 (7/7 items in the buffer)
 | |
|  consumed item 9 (6/7 items in the buffer)
 | |
|  produced item 16 (7/7 items in the buffer)
 | |
|  consumed item 10 (6/7 items in the buffer)
 | |
|  produced item 17 (7/7 items in the buffer)
 | |
|  consumed item 11 (6/7 items in the buffer)
 | |
|  produced item 18 (7/7 items in the buffer)
 | |
|  consumed item 12 (6/7 items in the buffer)
 | |
|  produced item 19 (7/7 items in the buffer)
 | |
|  consumed item 13 (6/7 items in the buffer)
 | |
|  produced item 20 (7/7 items in the buffer)
 | |
|  consumed item 14 (6/7 items in the buffer)
 | |
|  produced item 21 (7/7 items in the buffer)
 | |
|  consumed item 15 (6/7 items in the buffer)
 | |
|  produced item 22 (7/7 items in the buffer)
 | |
|  consumed item 16 (6/7 items in the buffer)
 | |
|  produced item 23 (7/7 items in the buffer)
 | |
|  consumed item 17 (6/7 items in the buffer)
 | |
|  produced item 24 (7/7 items in the buffer)
 | |
|  consumed item 18 (6/7 items in the buffer)
 | |
|  consumed item 19 (5/7 items in the buffer)
 | |
|  consumed item 20 (4/7 items in the buffer)
 | |
|  consumed item 21 (3/7 items in the buffer)
 | |
|  consumed item 22 (2/7 items in the buffer)
 | |
|  consumed item 23 (1/7 items in the buffer)
 | |
|  consumed item 24 (0/7 items in the buffer)
 |