This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/Logtalk/examples/threads/buffer/SCRIPT.txt

39 lines
961 B
Plaintext
Raw Normal View History

================================================================
Logtalk - Open source object-oriented logic programming language
Release 2.30.2
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::run(10)), threaded_ignore(consumer::run(10)).
producer wrote item 0
consumer read item 0
producer wrote item 1
consumer read item 1
producer wrote item 2
consumer read item 2
producer wrote item 3
consumer read item 3
producer wrote item 4
consumer read item 4
producer wrote item 5
consumer read item 5
producer wrote item 6
consumer read item 6
producer wrote item 7
consumer read item 7
producer wrote item 8
consumer read item 8
producer wrote item 9
consumer read item 9