Sponsored Content
Top Forums UNIX for Advanced & Expert Users Processes Communication Only with flags! Post 302155708 by vaggelakis on Saturday 5th of January 2008 05:21:52 AM
Old 01-05-2008
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.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

if flags

Hi folks. I'm just starting to teach myself shell scripting and am having some trouble with an if statement. I am working with a directory where only one file will reside at a time and need to evaluate if this file is compressed to determine subsequent steps. I'm using echo for testing purposes.... (2 Replies)
Discussion started by: kristy
2 Replies

2. UNIX for Advanced & Expert Users

What does bad elf flags mean?

Hi all! Could anybody tell me what this means? # /usr/local/sbin/sshd ld.so.1: /usr/local/sbin/sshd: fatal: /usr/local/lib/libcrypto.so.0.9.6: bad ELF flags value: 256 Killed Thanx (1 Reply)
Discussion started by: penguin-friend
1 Replies

3. Shell Programming and Scripting

makefile not taking -D flags

Hi, I found this strange behaviour while using one of the makefiles. Here is the snippet of the unix.mak that is necessary for this context SO = SvSocket.o SvStmt.o SvOdbcWrapper.o \ OdbcCallReader.o MgrCalls.o OdbcSvProxy.o \ OdbcSvApp.o... (4 Replies)
Discussion started by: vino
4 Replies

4. UNIX for Dummies Questions & Answers

Question about Setting Flags

I have a script which will look for a test folder under the parent directory. If the folder contains test folder then create the same directory structure in other remote machine. Once the directories are created then transfer all the contents of that test folder. this is what i am doing :- ... (2 Replies)
Discussion started by: chris1234
2 Replies

5. Shell Programming and Scripting

Need help to identify the flags by scripts.

Hi, I have two different scripts sap_ftp.sh and sap_ftp_dd.sh which are running continously in background. I am using another script called start.sh to launch these two scripts. Either one script will process files at a time . During that time other script will sleep.. Each script will... (1 Reply)
Discussion started by: bhargav20
1 Replies

6. UNIX for Dummies Questions & Answers

XLF90 Flags to PGF90

Hello, I am running into a bit of an issue running a Makefile. The problem is it was written for a xlf90 compiler when I have a pgf90 on the machine. Therefore, I keep getting errors regarding the xlf90 flags because they don't correspond with the pgf90. Here is the code: ... (0 Replies)
Discussion started by: lepagano
0 Replies

7. Shell Programming and Scripting

Communication between processes in Unix

hi folks!! I was stuck with a little problem where i needed to communcate between two processes, i.e., send a command to the parent process from the child process as soon as the child process terminates.This was required when i wanted to create a log using the script command in a bourne shell.The... (3 Replies)
Discussion started by: bdiwakarteja
3 Replies

8. UNIX for Dummies Questions & Answers

WHat are flags?

Can anybody actually tell, what is flag? I know they are termed as permission flags and various others. Please explain (3 Replies)
Discussion started by: nixhead
3 Replies

9. UNIX for Dummies Questions & Answers

Ifconfig Flags

Hi there, I need your help in understanding the below Solaris 10 ifconfig output; athnetspns02>ifconfig -a lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 e1000g0:... (2 Replies)
Discussion started by: wthomas
2 Replies

10. Shell Programming and Scripting

flags to avoid restart

hello all, i have the below script that we used to backup our DB using oracle's utility called RMAN. This has been working fine, but the issue is when the backup fails and we re-start it, it backups the whole thing again. Example. lets say i have 5 database on my system(db1,db2,db3,db4,db5)... (11 Replies)
Discussion started by: crazy_max
11 Replies
rpc(n)								 Tnm Tcl Extension							    rpc(n)

__________________________________________________________________________________________________________________________________________________

NAME
rpc - A simple RPC protocol for Tcl applications. _________________________________________________________________ DESCRIPTION
RPC COMMAND
rpc server port Set up an RPC server listening an port port. This command returns a rpc handle that be used to register Tcl procs that will be exported by a trivial RPC protocol on top of TCP. This RPC mechanism allows us to write cooperating scripts without worrying much about the communication protocol. rpc client host port Connect to the RPC server running on host with port port. The returned client handle can be used to invoke an exported proc on the server host. rpc delete handle Delete a server or a client RPC handle. All connections associated with the handle will be closed. rpc register rpchandle proc Export proc as an RPC callable proc using the server handle rpchandle. Only registered procs can be called by RPC clients. rpc unregister rpchandle proc Remove proc from the list of exported procs on server handle rpchandle. rpc info [rpchandle] Calling rpc info without any arguments returns a list of all rpc handles that have been created using the rpc server and rpc client command. Info about a specific rpc file handle rpchandle is returned by using the optional argument. The result is a list contain- ing the tcp file handle used for the communication and the list of registered commands for a rpc handle and a list of all files that represent connections to an rpc server. This list is empty if rpchandle belongs to a rpc client. rpc# [-async] proc arg1 arg2 ... To invoke a remote procedure proc, use the same syntax as used with a local invocation preceeded by a client rpchandle. The result of the remote procedure call will be returned or an error if the underlying communication channel signals errors. The -async options can be used to invoke proc without waiting for it to complete. The async option will never return a result. SEE ALSO
scotty(1), Tcl(n) AUTHORS
Juergen Schoenwaelder <schoenw@cs.utwente.nl> Tnm rpc(n)
All times are GMT -4. The time now is 02:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy