03-20-2008
Use a mutex or possibly a sempahore set to each value 1 - 6 (or whatever)
There are several ways to implement IPC - interprocess communication -
Read chapter 5 here:
Download Advanced Linux Programming
9 More Discussions You Might Find Interesting
1. Programming
Hi,
I am trying to implement the synchronize feature of java using C. I am using a semaphore for the same. I have a wrapper called "synch" to which I pass the function pointer(any_fn). This pointer points to the function (my_fn) which needs to be synchronized.
However to create the semaphore I... (8 Replies)
Discussion started by: linuxpenguin
8 Replies
2. Shell Programming and Scripting
Hi,
I have three Linux machine have three different times.
Can I synchronize them using one process?
I have root access.
Thanks! (1 Reply)
Discussion started by: whatisthis
1 Replies
3. Shell Programming and Scripting
I have 4 directory
Dir1
file1 file2 file3 file4
Dir2
file3 file5 file6 file8
Dir3
file1 file2 file6 file9 file10
Dir4
file3 file6 file12 file15
and all the 4 dirs are having couple of files.
Few of the files are common to other directory/ies and few... (1 Reply)
Discussion started by: reldb
1 Replies
4. UNIX for Advanced & Expert Users
hi.
i am writing a c program under bash shell.
i would like to use semaphore functions like sem_wait(), sem_post()
and i included <semaphore.h> and it compailes fine
but when i try to run it gives me an error "undefined reference to sem_wait() , sem_post() , sem_init()"
what have i missed... (2 Replies)
Discussion started by: emil2006
2 Replies
5. Programming
i am trying to synchronize between father process and son process
created by fork() command, to print simultaneously.
my program is written in c under bash shell.
the compile goes ok but when i try to run nothing happens and the program doesnot end.
my code is:
#include <stdio.h>... (1 Reply)
Discussion started by: emil2006
1 Replies
6. Shell Programming and Scripting
Hi,
I have two servers1&2, one is not in the network. Cant communicate from it to other servers. The second one can communicate to above mentioned server. I am trying a script which synchronizes files between server 1 an 2?
server1: cant communicate to any other servers
server2: can... (4 Replies)
Discussion started by: Tuxidow
4 Replies
7. Shell Programming and Scripting
Hi everyone!
I need to write a script that will synchronize two servers using FTP. So basically the script will get only the files that exist on the remote server that do not exist on the local server. Is there an option to do this when using mget? If not, is there a way to copy over only the... (2 Replies)
Discussion started by: Fatbob
2 Replies
8. AIX
Hi
Earlier we used to move the resource groups between nodes manually. Recently I have added the HACMP startup and stop scripts.
Then I moved the resource group to see if everything works fine as per the startup and stop scripts, but it didn't work out as expected.
Do i need to do bring... (4 Replies)
Discussion started by: samsungsamsung
4 Replies
9. UNIX for Advanced & Expert Users
Hello, I have the latest stable release of a UNIX-like O.S. in the ISO format, and want to synchronize it with the latest Release Candidate (RC) of it, in order to reducing bandwidth usage. The ISO images for that O.S. is provided via different protocols including rsync, FTP and HTTP
Is this... (4 Replies)
Discussion started by: temp-usr
4 Replies
LEARN ABOUT PLAN9
rendezvous
RENDEZVOUS(2) System Calls Manual RENDEZVOUS(2)
NAME
rendezvous - user level process synchronization
SYNOPSIS
#include <u.h>
#include <libc.h>
ulong rendezvous(ulong tag, ulong value)
DESCRIPTION
The rendezvous system call allows two processes to synchronize and exchange a value. In conjunction with the shared memory system calls
(see segattach(2) and fork(2)), it enables parallel programs to control their scheduling.
Two processes wishing to synchronize call rendezvous with a common tag, typically an address in memory they share. One process will arrive
at the rendezvous first; it suspends execution until a second arrives. When a second process meets the rendezvous the value arguments are
exchanged between the processes and returned as the result of the respective rendezvous system calls. Both processes are awakened when the
rendezvous succeeds.
The tag space is common to processes in the same file name space, so rendezvous only works between processes in the same file name space.
If a rendezvous is interrupted the return value is ~0, so that value should not be used in normal communication.
SOURCE
/sys/src/libc/9syscall
SEE ALSO
segattach(2), fork(2)
DIAGNOSTICS
Sets errstr.
BUGS
The correlation of rendezvous tags and file name space is a historical accident. If two unrelated processes happen to be in the same name
space and do a rendezvous, trouble will result. The solution is to call rfork(RFNAMEG) (see fork(2)) in programs that use rendezvous
unless they need to share the name space with their parent. This is especially important in Alef programs.
RENDEZVOUS(2)