Support different threads on prolog datamodel