Main > Programming > Libraries >

ShmFIFO library 1.0

ShmFIFO library 1.0

Sponsored Links

ShmFIFO library 1.0 Ranking & Summary

RankingClick at the star to rank
Ranking Level
User Review: 0 (0 times)
File size: 0.012 MB
Platform: Any Platform
License: GPL (GNU General Public License)
Price:
Downloads: 1306
Date added: 2006-03-30

ShmFIFO library 1.0 description

ShmFIFO library provides an easy-to-use interface to shared memory for programs where one process needs to send blocks of data to other processes.

It was developed because pipe(2) and mkfifo(3) have a very small buffer size (4k) and are unsuitable for many applications. Shmfifo allows you to put a block of data in shared memory, get the oldest block of data from shared memory.

ShmFIFO library also has the feature to share one instance of a private data structure among all processes which use the library.

How to use shmfifo

Before using, shared memory should be created. After creating shared memory, process which wants to use it, should attach to memory. Then it can put and get blocks to FIFO. After process is finished working with FIFO, it calls shfifo_detach. When no processes will use FIFO, shared memory should be deallocated.

Usally, lifecycle of shmfifo-based program is following:

[parent] shmfifo_create
[parent] fork(2)
[both] shmfifo_attach
[both] shmfifo_put, shmfifo_get (many times)
[both] shmfifo_detach
[parent] wait(2) or waitpid(2)
[child] exit
[parent] shmfifo_dealloc

shmfifo comes with test.c program, which is good sample of how to write programs with shmfifo. It forks into 2 processes, parent generated variable-length blocks, writes checksum into each block and put it into FIFO. Child gets blocks from fifo, check if checksum is valid (its always valid if there is no bug in program) and prints debug info. after large number of blocks gets transferred, both processes are exit.

Additionally, shmfifo allows processes to share one private structure. test.c uses this structure to store counter, which is increased each time when parent cannot put block to FIFO because its already full and has to wait until child will get block. If small amount of memory allocated for FIFO, then parent will wait more often.

Installation:

make
make test
su -
make install

test.c is sample test program which is builts into test binary. You can run it to test if library is working

ShmFIFO library 1.0 Screenshot

Advertisements

ShmFIFO library 1.0 Keywords

Bookmark ShmFIFO library 1.0

Hyperlink code:
Link for forum:

ShmFIFO library 1.0 Copyright

WareSeeker periodically updates pricing and software information of ShmFIFO library 1.0 full version from the publisher, so some information may be slightly out-of-date. You should confirm all information before relying on it. Software piracy is theft, Using crack, password, serial numbers, registration codes, key generators is illegal and prevent future development of ShmFIFO library 1.0 Edition. Download links are directly from our publisher sites, torrent files or links from rapidshare.com, yousendit.com or megaupload.com are not allowed

Allok Video Splitter 2.2.0 Review:

Name (Required)
Email(Required)
Captcha
Featured Software

Want to place your software product here?
Please contact us for consideration.

Contact WareSeeker.com
Related Software
Datalink library for Linux uses the SVGAlib to send data to the Timex DataLink watches. Free Download
Useful Terminal IO library is a C++ alternative to ncurses for working with terminfo-defined terminals. Free Download
C Algorithms Library is a collection of commonly used Computer Science algorithms. Free Download
Java DIME Library implements Direct Internet Message Encapsulation. Free Download
Quantity/Formatter Library provides a Java library made with the quantity/formatter pattern. Free Download
Redland RDF library is an RDF (Resource Description Framework) library. Free Download
The Java GetOpt library implements option parsing and a common online help behaviour. Free Download
Redline RPM Library is a pure Java library for manipulating RPM Package Manager packages. Free Download