I'm trying to install the gem mmap - it doesn't compile:
make "DESTDIR="
compiling mmap.c
In file included from mmap.c:15:0:
/usr/local/include/ruby-2.3.0/ruby/backward/rubyio.h:2:2: warning: #warning use "ruby/io.h" instead of "rubyio.h" [-Wcpp]
mmap.c:16:20: fatal error: intern.h: No such file or directory
compilation terminated.
make: *** [mmap.o] Error 1
=> make failed, exit code 2
The Web says, it's discontinued (2009) -- so what can I do (Linux, mri 2.3)?
The docs of the other gem simple_mmap says it's readonly, so doesn't make sense for me.
Any help welcome!!
I'm trying to install the gem mmap - it doesn't compile:
make "DESTDIR="
compiling mmap.c
In file included from mmap.c:15:0:
/usr/local/include/ruby-2.3.0/ruby/backward/rubyio.h:2:2: warning: #warning use "ruby/io.h" instead of "rubyio.h" [-Wcpp]
rubyio.h is Ruby 1.8-only
mmap.c:16:20: fatal error: intern.h: No such file or directory
Nowadays intern.h is ruby/intern.h
The author of the mmap gem, Guy Decoux died tragically.
The Web says, it's discontinued (2009) -- so what can I do (Linux, mri 2.3)?
The docs of the other gem simple_mmap says it's readonly, so doesn't make
sense for me.
Any help welcome!!
mmap doesn't make a lot of sense as a Ruby API, either. The
whole point of mmap is zero-copy, but at least these APIs
expose Ruby String objects, meaning data is copied into
userspace memory. So that defeats the point of zero-copy...
I suggest using pread/pwrite through the "io-extra" RubyGem
or even using fiddle or ffi to use those syscalls. You
won't get MAP_ANON, but you can use an unlinked Tempfile
in tmpfs similarly. Performance should be good, and lower
overhead than mmap()/munmap() on non-Linux.
One place where mmap might make sense for Ruby is exposing
non-strings, such as integer locations for atomic counters
across multiple processes. No data copies or object allocation
(until Bignum range...). The "raindrops" RubyGem I maintain
does this: Index of /raindrops/
Hi
Good infos, thanks!
I need it for sharing data-tables between processes (to do the calculations in parallel)
Conceptually I don't need an underlaying file, is there a gem for sharing this array-object (without copying it)?
Perhaps, than Ruby-locking could also be used over different processes!
thanks
Opti
···
On 2016-12-17 22:23, Eric Wong wrote:
Die Optimisten <inform@die-optimisten.net> wrote:
Hi
I'm trying to install the gem mmap - it doesn't compile:
make "DESTDIR="
compiling mmap.c
In file included from mmap.c:15:0:
/usr/local/include/ruby-2.3.0/ruby/backward/rubyio.h:2:2: warning: #warning use "ruby/io.h" instead of "rubyio.h" [-Wcpp]
rubyio.h is Ruby 1.8-only
mmap.c:16:20: fatal error: intern.h: No such file or directory
Nowadays intern.h is ruby/intern.h
The author of the mmap gem, Guy Decoux died tragically.
The Web says, it's discontinued (2009) -- so what can I do (Linux, mri 2.3)?
The docs of the other gem simple_mmap says it's readonly, so doesn't make
sense for me.
Any help welcome!!
mmap doesn't make a lot of sense as a Ruby API, either. The
whole point of mmap is zero-copy, but at least these APIs
expose Ruby String objects, meaning data is copied into
userspace memory. So that defeats the point of zero-copy...
I suggest using pread/pwrite through the "io-extra" RubyGem
or even using fiddle or ffi to use those syscalls. You
won't get MAP_ANON, but you can use an unlinked Tempfile
in tmpfs similarly. Performance should be good, and lower
overhead than mmap()/munmap() on non-Linux.
One place where mmap might make sense for Ruby is exposing
non-strings, such as integer locations for atomic counters
across multiple processes. No data copies or object allocation
(until Bignum range...). The "raindrops" RubyGem I maintain
does this: Index of /raindrops/
Can you use SQLite ? Parallel reads from a single file (not parallel write)
···
On 18 Dec 2016, at 18:48, Die Optimisten <inform@die-optimisten.net> wrote:
On 2016-12-17 22:23, Eric Wong wrote:
Die Optimisten <inform@die-optimisten.net> wrote:
Hi
I'm trying to install the gem mmap - it doesn't compile:
make "DESTDIR="
compiling mmap.c
In file included from mmap.c:15:0:
/usr/local/include/ruby-2.3.0/ruby/backward/rubyio.h:2:2: warning: #warning use "ruby/io.h" instead of "rubyio.h" [-Wcpp]
rubyio.h is Ruby 1.8-only
mmap.c:16:20: fatal error: intern.h: No such file or directory
Nowadays intern.h is ruby/intern.h
The author of the mmap gem, Guy Decoux died tragically.
The Web says, it's discontinued (2009) -- so what can I do (Linux, mri 2.3)?
The docs of the other gem simple_mmap says it's readonly, so doesn't make
sense for me.
Any help welcome!!
mmap doesn't make a lot of sense as a Ruby API, either. The
whole point of mmap is zero-copy, but at least these APIs
expose Ruby String objects, meaning data is copied into
userspace memory. So that defeats the point of zero-copy...
I suggest using pread/pwrite through the "io-extra" RubyGem
or even using fiddle or ffi to use those syscalls. You
won't get MAP_ANON, but you can use an unlinked Tempfile
in tmpfs similarly. Performance should be good, and lower
overhead than mmap()/munmap() on non-Linux.
One place where mmap might make sense for Ruby is exposing
non-strings, such as integer locations for atomic counters
across multiple processes. No data copies or object allocation
(until Bignum range...). The "raindrops" RubyGem I maintain
does this: https://bogomips.org/raindrops/
Hi
Good infos, thanks!
I need it for sharing data-tables between processes (to do the calculations in parallel)
Conceptually I don't need an underlaying file, is there a gem for sharing this array-object (without copying it)?
Perhaps, than Ruby-locking could also be used over different processes!