Sponsored Content
Full Discussion: synchronize as in java
Top Forums Programming synchronize as in java Post 48554 by S.P.Prasad on Wednesday 10th of March 2004 05:16:53 AM
Old 03-10-2004
Quote:
if any_fn is my_fn then semkey should be unique say sk
if any_fn is fn1 then semkey should be unique say sk1
if any_fn is fn2 then semkey should be unique say sk2
and so on
I tried a sample program with an array of function pointers and when I de-referenced it at any instances only the required code was executed.

Definitely the function pointer array contents were different but constant.

I might have wrongly analyzed the post.... but does this output helps you in anyway.

#include <stdio.h>

void (*fn[3])();

void my_fn()
{
printf ("my_fn\n" ) ;
}

void fn1()
{
printf ("fn1\n" ) ;
}

void fn2()
{
printf ("fn2\n" ) ;
}

main ( )
{
fn[0]=my_fn;
fn[1]=fn1;
fn[2]=fn2;

(*fn[0])();
(*fn[1])();
(*fn[2])();
}

Output:

my_fn
fn1
fn2

Is it possible to then take fn[0],fn[1],fn[2].... as semkey?
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to synchronize all the linux machine?

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

2. Shell Programming and Scripting

how to synchronize different dirs

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

3. Programming

need a way to synchronize processes

I am writing a program in C for my networking class, so I am relatively new to this. To begin, I have 7 processes that need do send messages to every other one, and every one of them needs to receive the messages sent by others. I am using fork() to create 6 more processes. The message... (1 Reply)
Discussion started by: inabramova
1 Replies

4. UNIX for Advanced & Expert Users

synchronize processes

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

synchronize two processes

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

Synchronize Files-Help

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

How to synchronize using FTP

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

Verify and Synchronize HACMP

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

How to synchronize two different files?

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
ipcrm(1)						    BSD General Commands Manual 						  ipcrm(1)

NAME
ipcrm -- remove the specified message queues, semaphore sets, and shared memory segments SYNOPSIS
ipcrm [-M shmkey] [-m shmid] [-Q msgkey] [-q msqid] [-S semkey] [-s semid] ... DESCRIPTION
Ipcrm removes the specified message queues, semaphores and shared memory segments. These System V IPC objects can be specified by their cre- ation id or any associated key. The following options are used to specify which IPC objects will be removed. Any number and combination of these options can be used: -M shmkey Mark the shared memory segment associated with key shmkey for removal. This marked segment will be destroyed after the last detach. -m shmid Mark the shared memory segment associated with id shmid for removal. This marked segment will be destroyed after the last detach. -Q msgkey Remove the message queue associated with key msgkey from the system. -q msqid Remove the message queue associated with the id msqid from the system. -S semkey Remove the semaphore set associated with key semkey from the system. -s semid Removes the semaphore set associated with id semid from the system. The identifiers and keys associated with these System V IPC objects can be determined by using ipcs(1) SEE ALSO
ipcs(1) BSD
August 8, 1994 BSD
All times are GMT -4. The time now is 01:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy