TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALL
from: LEON VARGHESE
date: 1997-09-05 06:29:00
subject: UNIX`s fork

Hello.
I hope I can ask this in here.
This involves running concurrent processes in UNIX using
fork().
Does anyone know how to pass variables from a parent process
to a child process?
e.g I have a variable producer. Then I create a child process.
char producer = 'A';
int pid = fork();                // now we have 2 processes
I want to increment producer to 'B' and pass it to the child.
The other way of doing this is creating a variable which is
shared in memory so that any process can access it.
I have no idea how to make shared memory variables either.
Any ideas.
-L
--- Blue Wave/DOS v2.30
---------------
* Origin: **Sawasdi BBS** sawasdi.apana.org.au 61 8 82617802 (3:800/846)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.