Sponsored Content
Full Discussion: Inter Process Communication
Top Forums Programming Inter Process Communication Post 4883 by kamathanil on Thursday 2nd of August 2001 12:51:36 PM
Old 08-02-2001
Data 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

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

Inter Process File Handling Problem

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

Problem with signals - 3 process communication

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

Inter-process communication:pipes,doors,etc.

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

C program using IPC (inter process communication)

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

help with write-read locks inter-process

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)

Inter-shell communication

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

logic understanding for inter client chat server

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

Application with communication between process

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

Implement inter vlan routing with Linux

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
SEM_OVERVIEW(7) 					     Linux Programmer's Manual						   SEM_OVERVIEW(7)

NAME
sem_overview - overview of POSIX semaphores DESCRIPTION
POSIX semaphores allow processes and threads to synchronize their actions. A semaphore is an integer whose value is never allowed to fall below zero. Two operations can be performed on semaphores: increment the semaphore value by one (sem_post(3)); and decrement the semaphore value by one (sem_wait(3)). If the value of a semaphore is currently zero, then a sem_wait(3) operation will block until the value becomes greater than zero. POSIX semaphores come in two forms: named semaphores and unnamed semaphores. Named semaphores A named semaphore is identified by a name of the form /somename; that is, a null-terminated string of up to NAME_MAX-4 (i.e., 251) characters consisting of an initial slash, followed by one or more characters, none of which are slashes. Two processes can operate on the same named semaphore by passing the same name to sem_open(3). The sem_open(3) function creates a new named semaphore or opens an existing named semaphore. After the semaphore has been opened, it can be operated on using sem_post(3) and sem_wait(3). When a process has finished using the semaphore, it can use sem_close(3) to close the semaphore. When all processes have finished using the semaphore, it can be removed from the system using sem_unlink(3). Unnamed semaphores (memory-based semaphores) An unnamed semaphore does not have a name. Instead the semaphore is placed in a region of memory that is shared between multiple threads (a thread-shared semaphore) or processes (a process-shared semaphore). A thread-shared semaphore is placed in an area of memory shared between the threads of a process, for example, a global variable. A process-shared semaphore must be placed in a shared memory region (e.g., a System V shared memory segment created using shmget(2), or a POSIX shared memory object built created using shm_open(3)). Before being used, an unnamed semaphore must be initialized using sem_init(3). It can then be operated on using sem_post(3) and sem_wait(3). When the semaphore is no longer required, and before the memory in which it is located is deallocated, the semaphore should be destroyed using sem_destroy(3). The remainder of this section describes some specific details of the Linux implementation of POSIX semaphores. Versions Prior to kernel 2.6, Linux supported only unnamed, thread-shared semaphores. On a system with Linux 2.6 and a glibc that provides the NPTL threading implementation, a complete implementation of POSIX semaphores is provided. Persistence POSIX named semaphores have kernel persistence: if not removed by sem_unlink(3), a semaphore will exist until the system is shut down. Linking Programs using the POSIX semaphores API must be compiled with cc -pthread to link against the real-time library, librt. Accessing named semaphores via the file system On Linux, named semaphores are created in a virtual file system, normally mounted under /dev/shm, with names of the form sem.somename. (This is the reason that semaphore names are limited to NAME_MAX-4 rather than NAME_MAX characters.) Since Linux 2.6.19, ACLs can be placed on files under this directory, to control object permissions on a per-user and per-group basis. CONFORMING TO
POSIX.1-2001. NOTES
System V semaphores (semget(2), semop(2), etc.) are an older semaphore API. POSIX semaphores provide a simpler, and better designed inter- face than System V semaphores; on the other hand POSIX semaphores are less widely available (especially on older systems) than System V semaphores. EXAMPLE
An example of the use of various POSIX semaphore functions is shown in sem_wait(3). SEE ALSO
sem_close(3), sem_destroy(3), sem_getvalue(3), sem_init(3), sem_open(3), sem_post(3), sem_unlink(3), sem_wait(3), pthreads(7) COLOPHON
This page is part of release 3.53 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. Linux 2012-05-13 SEM_OVERVIEW(7)
All times are GMT -4. The time now is 12:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy