shimfs
Version, currently master branch1 version
- master branchlatestFeb 15, 2025
github.com/globoplox/shimfs
Crystal lang IMFS binding and wrapper with inter process memory sharing
Installation
# Add this to your shard.yml
dependencies:
shimfs:
github: globoplox/shimfs
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
>= 1.15.1- License
- MIT
- Author
- globoplox
Dependencies
This version declares no dependencies.
README
Shimfs
Crystal binding to rdgarce/imfs with added shared memory support.
This may not work on plateform other than x86_64-linux-gnu and it require a linux kernel supporting mmap flag FIXED_MAP_NOREPLACE.
This shard need GCC to be available to compile the imfs.c file copied from the original repository.
Note imfs/imfs.c is taken from revision 940782b
Installation
-
Add the dependency to your
shard.yml:dependencies: shash: github: globoplox/shimfs -
Run
shards install
However since I wrote this shards for my own usage, you may be better off just copying the shimfs.cr file and using it as you feel like.
It probably wont be properly maintained nor stay stable.
Usage
require "shimfs"
require "wait_group"
if ARGV.size != 0
puts "Minion talk"
name = ARGV[0]
puts "Minion name: #{name}"
resource_name = ARGV[1]
size = ARGV[2].to_i
address = Pointer(Void).new ARGV[3].to_u64
shimfs = Shimfs.new size, resource_name, address
io = shimfs.open "hello", "r"
puts "#{name} read hello: #{io.gets}"
io.close
else
puts "Master talk"
shimfs = Shimfs.new 1024 * 128
io = shimfs.open "hello", "w"
io.puts "How are you ?"
io.close
self_bin = Process.executable_path.not_nil!
wg = WaitGroup.new 2
spawn do
Process.new(
self_bin,
args: ["Minion A", shimfs.resource_name, shimfs.size.to_s, shimfs.address.to_s],
output: :inherit, error: :inherit
).wait
wg.done
end
spawn do
Process.new(
self_bin,
args: ["Minion B", shimfs.resource_name, shimfs.size.to_s, shimfs.address.to_s],
output: :inherit, error: :inherit
).wait
wg.done
end
wg.wait
shimfs.close
puts "Master closing without harm"
end
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Feb 15, 2025
- Crystal
>= 1.15.1- Indexed
- yes
Dependents
Repository
github.com/globoplox/shimfs
Metadata
- Created
- Aug 19, 2026
- Updated
- Nov 12, 2026
- Synced
- Nov 12, 2026
- Versions
- 1