[erlang-questions] why is mmap so darn difficult
Wed Jun 12 09:32:42 CEST 2013
Tim, you are messing a bit about drivers and nifs.
There is absolutely no problem in implementing mmap for read in
erlang. I have done so in erlyvideo, but refused.
Mmap is absolutely unpredictable. Access to memory can take several
nanoseconds or several seconds. It is impossible to build a
good service when you have such fluctuations.
There is no problem in using file:pread and gen_tcp:send. At least,
erlyvideo can send several gigabits of video without mmap. It would be
impossible to achieve it with mmap, because you will not be able to
make it stable.
So, with mmap: you don't need it. It is a bad technology.
More information about the erlang-questions