Dataflow variables
Aleksey <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
Hi guys I'm curious what is the easiest way to imitate dataflow variables in Swi-Prolog My current idea is something like this (pseudocode): wait_for(X) :- freeze(X, awake_this_thread), suspend_this_thread. test :- do_work_in_separate_thread(Results), wait_for(Results), write(Results). I'm also interested if there is a way to make those predicates/functions that require some of their inputs to be bound to execute to automatically suspend until corresponding variables are bound, e.g.: test :- bind_X_in_separate_thread_after_long_calculation(X), Y is X+1, write(X). (here I expect for "Y is X+1" to suspend until X gets bound). -------------- next part -------------- HTML attachment scrubbed and removed