Managing linked list through child processes

Managing linked list through child processes

Post by Geec » Wed, 02 Jul 2003 02:54:30



Hi,

I have a few questions about unix tcp/ip programming (C -language).
1)  In client/server application I need to implement a dynamically linked
list which could be edited through child processes. So if I create this
linked list before calling the fork (), the child should be able to write
into the linked list elements or add an element to the list. How can  this
be done because when forking, the child process gets a copy of data and if
this child changes that data, the parent process doesn't see it.

2)  this problem is similar to the previous: before fork() there is an
item_counter which increases every time a child is created. Also every child
should be able to increase this item_counter value if necessary. How can the
item_counter hold its total value also outside of the child process?

Thanks.

 
 
 

Managing linked list through child processes

Post by Barry Margoli » Wed, 02 Jul 2003 02:57:04




>I have a few questions about unix tcp/ip programming (C -language).
>1)  In client/server application I need to implement a dynamically linked
>list which could be edited through child processes. So if I create this
>linked list before calling the fork (), the child should be able to write
>into the linked list elements or add an element to the list. How can  this
>be done because when forking, the child process gets a copy of data and if
>this child changes that data, the parent process doesn't see it.

>2)  this problem is similar to the previous: before fork() there is an
>item_counter which increases every time a child is created. Also every child
>should be able to increase this item_counter value if necessary. How can the
>item_counter hold its total value also outside of the child process?

Learn about "shared memory".

--

Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

1. smail failed to reap child process: No child processes

Offen I receive messages with error:

From MAILER-DAEMON Wed Dec 20 17:55:59 1995
To: postmaster
Subject: mail failed, sending to postmaster

|------------------------- Message log follows: -------------------------|

|------------------------- Failed addresses follow: ---------------------|

|------------------------- Message text follows: ------------------------|
Received: by fishwar.koenig.su; Wed, 20 Dec 95 17:55 GMT+0200
[...]

But mail successfully delivered to destination address.

What's wrong?

Alexander Feldman

2. midnite commander

3. Getting a child and child's child process-id

4. PPP PAP connect fails after giving IP addresses

5. how to kill a child process that runs other children processes

6. HELP PPP and dial up networking

7. Getting a child and child's child process-id

8. netfilter DNAT feature

9. ps not listing child process started by bash

10. How to get a list of all child pid's of the current process?

11. child process, child program

12. How to create memory in ptraced child process w/o child source code

13. kill child and its all grad child processes?