# Size limitations on qsave\_program?

**URL:** <https://swi-prolog.discourse.group/t/size-limitations-on-qsave-program/2560>\
**Category:** General\
**Created:** [June 24, 2020, 8:58pm UTC](https://swi-prolog.discourse.group/t/size-limitations-on-qsave-program/2560 "2020-06-24T20:58:47Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [June 28, 2020, 6:33pm UTC](https://swi-prolog.discourse.group/t/size-limitations-on-qsave-program/2560/11 "2020-06-28T18:33:53Z")

</div>

Regarding the concurrent creation, I’ve added concurrent\_forall/2,3 to library(threads), so we can create the DB using the code below. That does more or less the same as my previous post. The implementation of concurrent\_forall/3 is way more complicated to deal with failure and exceptions in the worker pool to abandon the computation and fail/throw. It was a bit of a challenge 🙂

```prolog
fill(N,M) :-
    concurrent_forall(between(1, N, I),
                      ( numlist(0, I, L),
                        random_permutation(L, K),
                        assert(t(I, L, K))
                      ),
                      [threads(M)]).

```

---

_[View the full topic](https://swi-prolog.discourse.group/t/size-limitations-on-qsave-program/2560)._
