Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ll-xn!mit-eddie!genrad!decvax!decwrl!sun!imagen!auspyr!sci!richd From: richd@sci.UUCP (Rich doherty) Newsgroups: comp.unix.wizards Subject: A very interesting problem -- multiprocessing Message-ID: <4589@sci.UUCP> Date: Fri, 1-May-87 03:20:26 EDT Article-I.D.: sci.4589 Posted: Fri May 1 03:20:26 1987 Date-Received: Sun, 3-May-87 06:15:50 EDT References: <7176@brl-adm.ARPA> Organization: Silicon Compilers Systems Corp. San Jose, Ca Lines: 51 I have a program that I have dynamically linked in several functions. I want this same program to call these functions, then send an interrupt to halt the function and return control momentarily to the main function, with the ability to return to the special function. In other words, I want: functionA() { /* garunteed infinite loop */ } functionB() { /* another infinite loop */ } main() { Start functionA and suspend it; Start functionB and suspend it; while (1) { continue functionA for 10 seconds; continue functionB for 10 seconds; } } I somehow want to do the equivalent of setjmp/longjmp, except that I want to remember many stack histories, and I do not want the stack to be unwound without someway to get it back. Note also that functionA and functionB will call other functions, and they may both call the same function -- hence I need local variables and stack calling history preserved. Again, I don't mind if functionA and functionB forget who called them, since they will never end. I could do this by having the program fork itself multiple times, and then suspend and continue each child copy. But I want all these functions to operate on the same global variables, and shared memory does not exist in BSD4.2 . I also intend to have several of these special functions, and forking that many times seems wasteful. I could make each of these satellite functions be actual programs, all running under the control of some main program. If this is the only way to solve this problem, then I need a suggestion as to how to rapidly send packets of data between processes (I assume that packet sending is fairly common, so that this solution should be feasible). Any comments or advice would be appreciated. -- Rich Doherty