🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.transputer
Article #1246

Re: Help needed -- cleaning an unsynchronous process

#1246
From: SHEHAB AM
Date: Thu, 01 Oct 1992 10:15
42 lines
2351 bytes
In <12964@ecs.soton.ac.uk> ams90@ecs.soton.ac.uk (SHEHAB AM) writes:


>I need to create lots of nearly identical worker processes
>dynamically.  Then once they have executed they return their
>results to their parent processes and should die.  It is when the die
>that my problem starts; how do I get rid of the process from the heap?
>The processes are not started by ProcPar...etc but by ProcRun for
>various reasons.  This means that I can not use ProcAllocClean which
>proved to crash the processors sometimes. I have tried free(process
>pointer) to no avail.

>Any ideas will be greatly appreciated.

Thanks for the resposes I have had from Mark Debbage,Alfred Rizzi, Rob Kurver, Peter Burgess and Andy Pepperdine who have supplied a number of ideas.  The consencus seeams to be an implementation as follows:

1. Pass into every process a channel, a different channel for each process.
Call this channel the "finish-channel".

2. At the end of each asynchronous process, write something to its
finish-channel.

3. When you wish to check whether a process is finished, do a ProcAlt on
its finish-channel. But when the finish-channel is selected, do NOT read
the input on it. Just take the response that it is ready to transfer.

4. At this point, the asynchronous process is known to be locked waiting to
complete an output. If the corresponding input is never performed, the process
cannot continue. So it is at this point that all the process's memory can
be freed. It is not in any execution queue.

5. In order to free all the memory, the processes must not use any default
allocations, so use ProcInit and specify the actual memory area it should
use for the heap.

6. Each asynchronous process must also free all the memory it uses for
its own processing before writing to its finish-channel, ie. put its own
house in order before leaving.

many thanks to Andy Pepperdine for the above steps.

AMS....
Technical Details
Message-ID: <12971@ecs.soton.ac.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!doc.ic.ac.uk!sot-ecs!ams90
References: <12964@ecs.soton.ac.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!uknet!doc.ic.ac.uk!sot-ecs!ams90
From: ams90@ecs.soton.ac.uk (SHEHAB AM)
Newsgroups: comp.sys.transputer
Subject: Re: Help needed -- cleaning an unsynchronous process
Keywords: transputer inmos c
Message-ID: <12971@ecs.soton.ac.uk>
Date: 1 Oct 92 10:15:13 GMT
References: <12964@ecs.soton.ac.uk>
Sender: news@ecs.soton.ac.uk
Lines: 42
Nntp-Posting-Host: kyd