Path: utzoo!attcan!uunet!seismo!dimacs.rutgers.edu!mips!troi!peter From: peter@dbaccess.com (Peter A. Castro) Newsgroups: comp.sys.amiga.tech Subject: Re: Children and message ports Message-ID: <886@troi.dbaccess.com> Date: 5 Nov 90 22:20:45 GMT References: <9011021641.AA18389@luke.eecs.wsu.edu> Organization: DB Access Inc., Santa Clara, CA Lines: 45 in article <9011021641.AA18389@luke.eecs.wsu.edu>, hakimian@LUKE.EECS.WSU.EDU says: + + I have created a child process using CreateProc. In the child I call + FindTask to find my task (process) pointer. I then wait on my process + message port + + proc = (struct Process *)FindTask(0); + port = proc->pr_MsgPort; + WaitPort(proc); + + In the parent I send a message to the child. + + procid = CreateProc(name,pri,seg,stack); + PutMsg(procid,msg); + + The result, Task held ... + + The eventual guru is 8700004 (not sure on the # of 0). I think this means + bad packet to the dos library. Does it? How did I do that? Yes, you did. The CreateProc() function returns a Process structure pointer. You must extract the MsgPort out of this structure and use it in your call : PutMsg(procid->pr_MsgPort,msg). Look in your friendly include directory for these: libraries/dosextens.h, exec/tasks.h + + This code is in a device driver if that makes any difference. + + I have commented out the PutMsg to see if that was the problem. It is. + what is wrong with my PutMsg? Did I miss something? + + By the way the child task is running. BTW: If you linked your child task with standard startup code, it is probably waiting for a cli/workbench startup message in the startup code. If you have it, look in the Rom Kernel Manuals. If I remember correctly, there are some *corrected* examples which might help you. + + Please reply by email, post, homing pigeon, any way you can! Thanks -- Peter A. Castro INTERNET: peter@dbaccess.com // //| c/o DB Access Inc. UUCP: {uunet,mips}!troi!peter // //|| 2900 Gordon Avenue, Suite 101 FAX: (408) 735-0328 \\ // //-||- Santa Clara, CA 95051-0718 TEL: (408) 735-7545 \// // ||