interprocess: Shared memory and control structures for IPC

[ bsd3, library, system ] [ Propose Tags ]

Provides portable shared memory allocator and some synchronization primitives. Can be used for interprocess communication. Refer to README.md for further information.


[Skip to Readme]

Flags

Automatic Flags
NameDescriptionDefault
examples

Build example-test programs

Disabled
dev

Development build with debugging and with no optimization

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.2.0.0, 0.2.0.1, 0.2.1.0
Dependencies base (>=4.8 && <5), interprocess, typed-process (>=0.2) [details]
License BSD-3-Clause
Copyright (c) 2018 Artem Chirkin
Author Artem Chirkin
Maintainer chirkin@arch.ethz.ch
Category system
Home page https://github.com/achirkin/interprocess
Uploaded by achirkin at 2018-07-08T15:10:19Z
Distributions NixOS:0.2.1.0
Reverse Dependencies 1 direct, 0 indirect [details]
Executables wait-mvar, wait-qsem, concurrent-malloc
Downloads 1719 total (18 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-07-08 [all 1 reports]

Readme for interprocess-0.2.0.0

[back to package description]

interprocess

WIP: platform-independent interprocess communication.

The core feature is shared memory allocator implemented using POSIX mmap and Windows CreateFileMapping. You can create as many allocators as you want (as your RAM can afford) and concurrently malloc and free memory in different processes using them.

Features and TODO:

  • Foreign.SharedPtr -- malloc, realloc and free in the shared memory region that can be accessed by multiple processes.
  • Semaphores
  • Mutexes (not sure if need this)
  • Mutable variables via Storable instance plus garbage collection.
  • Proper error messages
  • Debug, verbose mode

The idea of the library is to address GHC stop-the-world GC problem:

  1. Create several instances of your program in different isolated processes using e.g. typed-process library.
  2. Establish shared memory and semaphore usage via this program
  3. Garbage collection events in one process do not affect another one at all. Profit!