Newsgroups: comp.sys.transputer,comp.sys.transputers
From: amd2@ukc.ac.uk (A.M.Douglas)
Subject: Spawning processes and CS-Tools and the CSN and stuff!
Organization: University of Kent at Canterbury, UK.
Date: Mon, 30 May 94 15:55:02 GMT
Message-ID: <9272@eagle.ukc.ac.uk>


I have a question.

I am using the CS-Tools C compiler and CSN libraries.  What I want to do is
to spawn processes which connect to the CSN to talk to some existing processes.
I have investigated spawning processes on the meiko surface itself, but at the
moment I'm running some processes (those which spawn) on a Sun3 host, and the
other processes (those being spoken with - they act as a global data structure,
effectively) on the meiko.

Host to Meiko communication is OK to begin with - the main process calls csn_init,
gets a transport and the netid of the meiko process it is to talk with.

When I fork() processes on the host, though, things don't work.  My original strategy
was to do this:

   1) close the existing transport.

   2) fork()

   3) open new transport, and lookupname the meiko process I wish to talk to.

   4) the original process continues, and the forked process does some work,
      followed by a csn_close and a csn_exit.

This doesn't work.  I've tried a number of alternatives - only the forked proces
opens new transport etc, trying csn_init after the fork.  None of these work.
I get problems trying to cs_open new transports - it always seems to work once,
and after that I get things like:

   [csn error]: csn: cannot allocate netId 0x81 (already in use)


Can anyone help?  The essential point is that the original and the forked process
must have separate transports, and may be talking to different meiko processes.

Thanks in advance,

Andrew Douglas.

