The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
function and pipe Orbix UNIX for Dummies Questions & Answers 2 01-01-2008 03:57 AM
Replace a Pipe with tab srikanthus2002 Shell Programming and Scripting 1 04-25-2007 06:22 AM
Named PIPE Tamil UNIX for Dummies Questions & Answers 2 01-17-2007 03:20 AM
Problem with pipe into sed 98_1LE Shell Programming and Scripting 2 08-13-2005 04:40 PM
PIpe Spy jodders High Level Programming 11 02-18-2004 10:44 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 02-21-2002
bb666 bb666 is offline
Registered User
  
 

Join Date: Jan 2002
Location: romania
Posts: 10
pipe help

i made a lot of processes. here is the code:

main()
{
printf("\nEnter K="); scanf("%d",&k);
printf("Enter L="); scanf("%d",&l);
printf("\nFather id=%d\n",getpid());
x=0;
makechild();
sleep(2);
return 1;
}
int makechild()
{
for(q=1;q<=k;q++)
{
if(f=fork())
{
}
else
{
printf("\nChild id=%d owner=%d\n",getpid(),getppid());
++x;
if(x<l) makechild();
sleep(1);
exit(0);
}
}
return;
}

it basically creates a tree of processes over L rows, each process having K sons.

now, my question is: how can i make these processes comunicate between them?
i figured i would need a lot of pipes but i can't seem to implement them and i'm getting sick with 'broken pipe' error.
can anyone give me some advice?
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:38 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0