Hi Henrik,

> The fact that Clojure enforces this way of working is seen as one of it's
> greatest virtues and strengths. If PicoLisp's boss works in the same way you
> have the same situation where you don't have to worry about inconsistent
> data.

In PicoLisp you usually don't have to worry about inconsistent data.

The threads ('task's) are strictly cooperative (not preemptive), and
database modifications by separate processes are synchronized

However, I would not stress (or mention) 'boss' here. Typically, IPC
between PicoLisp processes, and DB modifications, are coordinated
between sister processes by the same parent (the "boss") in an implicit
way. Talking to "boss" directly, and forcing it to do things, I regard
as quite dangerous, because the parent should be loaded as little as
possible and - more important - should not execute any application-
level code. The parent should never be allowed to crash, as this would
cut IPC between the children and give undefined results.

Instead, sister processes send messages to each other via 'tell'
(broadcasted, or to selected processes), and synchronize DB operations
via 'put!>' (or 'dbSync', 'put>' and 'commit' sequences), which also use
'tell' internally. 'tell' has a well-defined behavior, as it is
dispatched centrally by the parent, and the resulting events in the
children's tasks are non-preemptive again.

> (pipe (boss 'addToFoo 2))
> (pipe (boss 'multiplyFooWith 3))

Using pipe in that way to create a short-term child process is an
interesting idea. I would rather have done it the obvious way:

      (unless (fork)
         (boss 'addToFoo 2)
         (bye) )

But why not? 'pipe' should work here, and it is shorter. The drawback is
some system call overhead.

- Alex
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to