![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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. |
|
||||
|
Quote:
I suggest you look at UNIX semaphores. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|