Thread View: comp.sys.transputer
3 messages
3 total messages
Started by SHEHAB AM
Wed, 30 Sep 1992 14:57
Help needed -- cleaning an unsynchronous process
Author: SHEHAB AM
Date: Wed, 30 Sep 1992 14:57
Date: Wed, 30 Sep 1992 14:57
20 lines
1086 bytes
1086 bytes
Hi everyone, I have come across a little problem; it goes as follows: 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. ams... (ams@par.soton.ac.uk). PS: does anyone know the email address of technical support at inmos?
Re: Help needed -- cleaning an unsynchronous process
Author: Nigel Holder
Date: Thu, 01 Oct 1992 08:51
Date: Thu, 01 Oct 1992 08:51
32 lines
1969 bytes
1969 bytes
In article <12964@ecs.soton.ac.uk> ams90@ecs.soton.ac.uk (SHEHAB AM) writes: > >Hi everyone, > > I have come across a little problem; it goes as follows: > >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. The next release of the ANSI C toolset relaxes the restriction that ProcAllocClean may only be used with synchronous processes. A new function has been introduced which allows a parent process to wait for an asychronous child process to terminate (similar to wait in a UNIX shell script) to ensure that ProcAllocClean is not applied to an executing process. Please contact your normal supplier for release dates of the next ANSI C toolset as I'm afraid I don't know them. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Nigel Holder, Software Group, INMOS Ltd Tel +44 454 616616 1000 Aztec West Fax +44 454 617910 Almondsbury UK: nigel@inmos.co.uk Bristol BS12 4SQ, UK. US: nigel@inmos.com "Lost in time like tears in rain. Time to die" Blade Runner
Re: Help needed -- cleaning an unsynchronous process
Author: SHEHAB AM
Date: Thu, 01 Oct 1992 10:15
Date: Thu, 01 Oct 1992 10:15
42 lines
2351 bytes
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....
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads