08-02-2001
Inter Process Communication
unix IPC
i would like to know the method of usage of semaphores on shared memory segments the topic seems very difficult to understand mainly when difrent proceses communicate instantly and how do i avaoid deadlock situation
10 More Discussions You Might Find Interesting
1. Programming
signal in process communication:
I 'm a example in sun_unix that signal in process communication
It's here down but I only have freebsd in my machine.
how can i do the same in freebsd
eg:
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
int
main( void ){
void... (2 Replies)
Discussion started by: a9711
2 Replies
2. HP-UX
Hi All,
i am running a oracle procedure which writes a file . The same file is picked up by another script which runs in a cron after every 5 minutes.
Now the problem is that sometimes my script picks up a file while the procedure is still writing data in the file.
is there is any way i... (4 Replies)
Discussion started by: saurabhjain
4 Replies
3. Programming
Hello,
I would like to ask you for a little help with program I'm working on. I have problems with signals and synchronizing processes (I'm quite new to this part of programming).
Process "parent" creates new child process "child1" and this process creates new child process "child2". The... (2 Replies)
Discussion started by: Nightwright
2 Replies
4. UNIX for Advanced & Expert Users
Hi,
I am thinking about writing a log daemon for a multi-processed ksh application (yes - I know that high-level language would be a better option).
My question is as follows:
If many processes (many scripts) will try writing to a single log file:
print "message" > common.log
Will it work or... (2 Replies)
Discussion started by: adderek
2 Replies
5. Programming
i want to write a C chat program that communicates over IPC(inter process communication), that could be run using 2 seperate terminal windows within the same computer. so that wat u type in one terminal window , should appear on the other and vice versa...
could some one please help me with the... (2 Replies)
Discussion started by: localp
2 Replies
6. Programming
I need help!Many Thanks!
Now,I try to manage the shared memory inter-process .
Inevitably,I have to deal with the synchronous.
I know the pthread_rwlock in posix,and I compile ,then run successfully in Red Hat Enterprise 4.
I have a doubt about whether the Posix supports the system such as... (1 Reply)
Discussion started by: weizh
1 Replies
7. OS X (Apple)
If I open two bash shells and telnet from Shell 2 to a remote server (on the Net), is there a way to direct input from Shell 1 to the telnet shell?
The telnet shell is a limited environment with a specific command set.
I want to direct commands from Shell 1 and, if possible, put 1-second... (2 Replies)
Discussion started by: xinUoG
2 Replies
8. Programming
hello everyone,
i am making chat server in linux using c. i have made programs in which group chat can take place between multiple clients but i am not able to understand how to make 2 particular clients chat with each other. please help!!! (1 Reply)
Discussion started by: sweetbella
1 Replies
9. Programming
Hello
I would like to create an application with communication between processes,
application tightly coupled, have you please an idea about an API or
a tool that allows me to generate such application?
Thank you so much (11 Replies)
Discussion started by: chercheur857
11 Replies
10. IP Networking
Hello. I want to Communicate 2 VLAN with router like this solution:
http://8pic.ir/images/83m0ouih8mmm9s1sfl56.jpg
For this purpose I'm configuring 2 Linux system as a switch and connect 4 host to them. Then a router is added to scenario.
The configuration of the switches is:
On DUT1(Linux):... (1 Reply)
Discussion started by: zsn
1 Replies
LEARN ABOUT SUSE
ipc::sharedmem
IPC::SharedMem(3pm) Perl Programmers Reference Guide IPC::SharedMem(3pm)
NAME
IPC::SharedMem - SysV Shared Memory IPC object class
SYNOPSIS
use IPC::SysV qw(IPC_PRIVATE S_IRUSR S_IWUSR);
use IPC::SharedMem;
$shm = IPC::SharedMem->new(IPC_PRIVATE, 8, S_IRWXU);
$shm->write(pack("S", 4711), 2, 2);
$data = $shm->read(0, 2);
$ds = $shm->stat;
$shm->remove;
DESCRIPTION
A class providing an object based interface to SysV IPC shared memory.
METHODS
new ( KEY , SIZE , FLAGS )
Creates a new shared memory segment associated with "KEY". A new segment is created if
o "KEY" is equal to "IPC_PRIVATE"
o "KEY" does not already have a shared memory segment associated with it, and "FLAGS & IPC_CREAT" is true.
On creation of a new shared memory segment "FLAGS" is used to set the permissions. Be careful not to set any flags that the Sys V IPC
implementation does not allow: in some systems setting execute bits makes the operations fail.
id Returns the shared memory identifier.
read ( POS, SIZE )
Read "SIZE" bytes from the shared memory segment at "POS". Returns the string read, or "undef" if there was an error. The return value
becomes tainted. See shmread.
write ( STRING, POS, SIZE )
Write "SIZE" bytes to the shared memory segment at "POS". Returns true if successful, or false if there is an error. See shmwrite.
remove
Remove the shared memory segment from the system or mark it as removed as long as any processes are still attached to it.
is_removed
Returns true if the shared memory segment has been removed or marked for removal.
stat
Returns an object of type "IPC::SharedMem::stat" which is a sub-class of "Class::Struct". It provides the following fields. For a
description of these fields see you system documentation.
uid
gid
cuid
cgid
mode
segsz
lpid
cpid
nattach
atime
dtime
ctime
attach ( [FLAG] )
Permanently attach to the shared memory segment. When a "IPC::SharedMem" object is attached, it will use memread and memwrite instead
of shmread and shmwrite for accessing the shared memory segment. Returns true if successful, or false on error. See shmat.
detach
Detach from the shared memory segment that previously has been attached to. Returns true if successful, or false on error. See shmdt.
addr
Returns the address of the shared memory that has been attached to in a format suitable for use with "pack('P')". Returns "undef" if
the shared memory has not been attached.
SEE ALSO
IPC::SysV, Class::Struct
AUTHORS
Marcus Holland-Moritz <mhx@cpan.org>
COPYRIGHT
Version 2.x, Copyright (C) 2007, Marcus Holland-Moritz.
Version 1.x, Copyright (c) 1997, Graham Barr.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.12.1 2010-04-26 IPC::SharedMem(3pm)