Process Control in Prolog 
Author Message
 Process Control in Prolog


Question :
        How can I do process control in Prolog ?

For example, I would like to implement the following:

        1. Parent process fork a child process
        2. Parent process wait for a condition is set
        3. Child finishes and set the condition
        4. Child exits
        5. Parent continues.

Thanks in advance.

(By the way, this is not my homework)

                                Paul Ling
                                uunet!88opensi!pling or

Mon, 10 Aug 1992 02:44:49 GMT  
 Process Control in Prolog


> Question :
>    How can I do process control in Prolog?
> For example, I would like to implement the following:
>    1. Parent process forks a child process
>    2. Parent process waits for a condition to be set
>    3. Child finishes and sets the condition
>    4. Child exits
>    5. Parent continues.

The sequence of steps described above is no more and no less than
a procedure call.  You only need multiple processes when the parent
must continue while the child is still running.  UNIX programs
typically use "fork" simply to get a new address space; other
operating systems (AEGIS, Multics, B6700/MCP, Lilith) allow a
program to be "called" in the same address space.

Many Prolog systems provide a built in command called system/1,
or something like that, so you could do
        system('prog arg')
        unix(system('prog arg'))
        sh('prog arg')
or something similar.  NU Prolog provides 'fork' and 'wait' as
built in commands; Prologs with a C interface let you add them
easily, and Prologs-with-source like C Prolog and SB Prolog also
let you add them easily.

If you want multi-threading where parent and child processes are
both Prolog, and more than that, share the same address space,
there are some extensions to Prolog around which will let you do
it, but it's not very common (yet).

What are you really trying to accomplish?

Tue, 11 Aug 1992 10:58:54 GMT  
 Process Control in Prolog


>Question :
>       How can I do process control in Prolog ?

Don't do it in Prolog, do it in Parlog or one of the other
concurrent logic languages. See, e.g. Ringwood's paper
"Parlog-86 and the Dining Logicians" CACM 31,1 - Jan. 1988

or Shapiro and Takeuchi's "Object-Oriented Processing in
Concurrent Prolog", New Generation Computing, 1,1 1983

or mail me for a few unpublished papers I'm working on.

Matthew Huntbach

Sat, 15 Aug 1992 01:49:06 GMT  
 [ 3 post ] 

 Relevant Pages 

1. Standard for Process Control (was: More X3J20 Comments)

2. Need a CW55 compatible word processing/mailmerge control

3. Granting Window / process absolute control??

4. Industrial robotics & Process control

5. Industrial robotics & Process control

6. Industrial robotics & Process control

7. Industrial robotics & Process control

8. Language, Operating System, Hardware for Industrial Process Control.

9. Forth in process control "Idam"?

10. control structure for parallel processes

11. Process control languages?

12. lisp :-> Scheme re: process control


Powered by phpBB® Forum Software