I am thinking to use global backtrackable variables to store dynamic information across predicates, thereby simplifying the argument structure of predicates.
At the same time, I am looking for opportunities to use multiple threads and understand that currently global variables are stored for each thread – i.e. have their own name space.
I guess what this means is that to pass information taken from global variables into threads, requires to read their contents and pass it as argument the the “threaded” goal, and then upon return of the threaded goal, to set the global variable with an obtained return value.
Is this the way this is supposed to be done? Any limitations this could cause?
The alternative is to not use global variables and pass global information as arguments …
any thoughts are much appreciated,
Edit: I guess one key issue could be memory overhead when larger structures are read and (re)set from/to global variables. In structures that are passed as arg, this is, i guess, not happening.