Date: Tue, 29 Sep 1998 03:24:04 +0200 From: Purrcat <K.Staring@UCI.KUN.NL> To: questions@FreeBSD.ORG Subject: shared mem between parent & child Message-ID: <361036B3.FCE6DA8F@uci.kun.nl>
next in thread | raw e-mail | index | archive | help
Hi, Is there any way that I can share an int between a parent process and some child processes? I'm writing a program which must do about this: the children (created by a fork of course) increase a shared integer variable when they're busy, and when they're not busy anymore, decrease the shared integer with 1. The parent makes some non-educated guesses about this; when all children are busy, the parent forks some more to create some leeway.. I think I can do this with a shared variable (if this kind of thing exists anyway).. If there's no such thing as a 'shared variable', could it be done in another way (like stdin and stdout or something?) thanx for the repy if you should decide to.... -- Khamba Staring "Windhose NT can be run by any idiot, and it usually is too..." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?361036B3.FCE6DA8F>