Quantcast
Channel: Frank Sun » C
Browsing all 10 articles
Browse latest View live

Communicating Between Parent and Child

Communicating Between Parent and Child The following main function runs as a server. It uses IPC_PRIVATE to request a private shared memory. Since the client is the server’s child process created after...

View Article



shmdt() and shmctl() – detaching and removing a shared memory segment

Detaching and Removing a Shared Memory Segment – shmdt() and shmctl() System call shmdt() is used to detach a shared memory. After a shared memory is detached, it cannot be used. However, it is still...

View Article

Communicating between two separate processes

Communicating Between Two Separate Processes In this example, the server and client are separate processes. First, a naive communication scheme through a shared memory is established. The shared memory...

View Article

background Processes and shared memory status

Background Processes and Shared Memory Status Background and Foreground Processes Starting a process in background is easy. Suppose we have a program named bg and another program named fg. If bg must...

View Article

Formatting C / C++ code

Formatting C / C++ code by: WaltP – Aug 11, 2005 (ref: http://www.gidnetwork.com/b-38.html) To help understand the flow of your C/C++ code, whitespace (spaces, tabs, new lines) are all ignored by the...

View Article


gcc: Compilation Warning: incompatible implicit declaration of built-in...

reference: ttp://joysofprogramming.com/gcc-incompatible-implicit-declaration-exit/ Posted by Joys of Programming on in C/C++ The purpose of exit() as described by the man page exit - cause normal...

View Article

lseek() – (C System Call)

lseek is a system call that is used to change the location of the read/write pointer of a file descriptor. The location can be set either in absolute or relative terms. Required Include Files #include...

View Article

sem_overview

Namesem_overview – Overview of POSIX semaphores Description POSIX semaphores allow processes and threads to synchronise their actions. A semaphore is an integer whose value is never allowed to fall...

View Article


Deadlock

====== Deadlock  ===== Conditions for Deadlock 1. deadlock prevention 2. deadlock avoidance Prevention - made some one of the conditions necessary for deadlock don’t hold Avoidance - OS gets info about...

View Article


Virtual Memory

It is desirable to be able to execute a process whose logical address space is larger than the available physical address space. Virtual memory is a technique that enables us to map a large logical...

View Article
Browsing all 10 articles
Browse latest View live




Latest Images