________________________________________________________________________

This file is part of Logtalk <http://logtalk.org/>  

Logtalk is free software. You can redistribute it and/or modify it under
the terms of the FSF GNU General Public License 3  (plus some additional
terms per section 7).        Consult the `LICENSE.txt` file for details.
________________________________________________________________________


% 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)
