Dear CIAO Users
I have been playing about with multithreading in CIAO Prolog and came across what I believe to be a strange side-effect of debugging on a simple piece of code.
If I load the following piece of code
:- use_module(library(dynamic)). :- use_module(library(concurrency)). :- concurrent p/1. :- concurrent q/1.
try:- eng_call(test,create,create).
test:- retract_fact(p(X)), asserta(q(X)).
And type
?- try.
I then am able to assert p(Something) and that gets re-written as q(Something):
?- asserta_fact(p(a)).
yes ?- retract_fact_nb(q(A)).
A = a ?
However, if I try to debug the code, then it won't work! Check it out:
?- try. 1 1 Call: user:try ? 2 2 Call: concurrency:eng_call($:(user:test),create,create) ? 2 2 Exit: concurrency:eng_call($:(user:test),create,create) ? 1 1 Exit: user:try ?
yes {trace} ?- asserta_fact(p(a)).
yes {trace} ?- retract_fact_nb(q(A)).
no
What is going on here? Am I missing something?
Thanks for any help!