Process control and communications

gwyn at brl-smoke.UUCP gwyn at brl-smoke.UUCP
Sun Mar 30 09:31:46 AEST 1986


In article <698 at watdragon.UUCP> wasaunders at watdragon.UUCP (Parallel Hair???) writes:
>Being fairly new at the unix game I have a question to ask of all you Whee-Zards
>out there ... actually it is more of a problem than a question, but anyway ...
>
>I would like to set up a time-sharing system (a small one). One of the things
>I would like to do is to include a multi-user game which I have been thinking
>of writing. The events during the game are to take place in real time, so
>one possible architecture for the software would be to have one games master,
>with player processes forked from it. When someone logs into my system they
>are given a CI (shell, whatever ....) - if they want to play the game how
>can I associate the player process with their port, and then restore their
>CI when they are one playing?

Assuming you plan to use UNIX:  You can't in general attach a terminal
to an already-running process, so your best bet is to have a game master
process that reads a FIFO, socket, or (if you don't have FIFOs or sockets)
a locked known file to get slave data (part of which for a new slave
would be information on how to send data back to the player), and start
up a fresh slave player process when a new player enters the game.

Games like this have been distributed publicly, for example on USENIX
tapes.  One that was popular at JHU was called "search".

Termination of a fork/execed process from the shell will return to the
shell automatically; no magic required there.



More information about the Comp.unix.wizards mailing list