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 > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Monitoring Processes - Killing hung processes ukndoit UNIX for Advanced & Expert Users 4 01-17-2008 04:30 AM
Making flags for my script rcunn87 Shell Programming and Scripting 6 06-29-2006 10:23 AM
makefile not taking -D flags vino Shell Programming and Scripting 4 04-25-2005 09:19 AM
What does bad elf flags mean? penguin-friend UNIX for Advanced & Expert Users 1 01-16-2002 10:27 AM
if flags kristy UNIX for Dummies Questions & Answers 2 05-07-2001 04:08 PM

Closed Thread
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
  #1 (permalink)  
Old 01-05-2008
vaggelakis vaggelakis is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 1
Processes Communication Only with flags!

hello everybody and a happy new year!

i am trying the client-server model...i have no problem with sockets etc...
especially for server:there is a father who is listening for TCP connections from clients,the later send commands which parent shares to his children.
then children execute commands and send the results to each client through UDP connectionless communication...
my problem is that father,who read commands from clients,read them to a pipe and children processes reads them from there...the first free child must read command from a pipe to which parent is writing.

unfortunately we are not supposed to use thread-mutex-shared memory-
we only can use a flag which allows a child to read o command (message from father each time) and i don't know how to use that flag...
i must have a flag to a pipe and the first free process takes the flag read the message and puts back the flag...how can i do something like that?

i see that there is a need for such a flag because when i have one pipe
and e.g.:5 children let the parent write a command to the pipe
then we need only one child to read the whole command...which won't happen without a flag preventing other children from reading until the above child reads the whole command and put back the flag...

thanks a lot!

note:we have NUMCHILDREN children given as an argument.
  #2 (permalink)  
Old 01-05-2008
porter porter is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2007
Posts: 2,965
Quote:
Originally Posted by vaggelakis View Post
unfortunately we are not supposed to use thread-mutex-shared memory
This sounds like homework.

Quote:
Originally Posted by vaggelakis View Post
we only can use a flag which allows a child to read o command (message from father each time) and i don't know how to use that flag
I suggest you look at UNIX semaphores.
Closed Thread

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 11:09 PM.


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