[erlang-questions] Porint erlang on rumpkernel

Lukas Larsson garazdawi@REDACTED
Wed Aug 26 10:14:06 CEST 2015


Hello!

On Wed, Aug 26, 2015 at 8:25 AM, Neeraj Sharma <neerajsharma.live@REDACTED>
wrote:

> Hi,
>
> I am trying to port erlang on rumpkernel and running into some issues.
> RumpKernel do not have fork/execve, so there are some constraints. Please
> note that I am new to erlang internals, so please be a bit more verbose.
>
> 1. Erlang allocates pages which are aligned to superblock. I found strange
> pthread issues and debug it to due to the mmap allocation which does
> multiple allocation/deallocation to get the desired alignment. Can this be
> changed to align on just the pagesize instead? Is the alignment a strict
> requirement?
>

It is not a strict requirement. For instance windows and ose do not have
use this feature. It can be disabled by playing around with the defines in
erl_mmap.h. There might also be a configure test for it, can't remember of
the top of my head.


>
> 2. Erlang fork/execve, which is bad when running on rump because there is
> no such support at present. I am trying to run beam directly and even got a
> shell but then things fail while trying to run erlang application. I
> suspect that there are more fork at other places (probably for port). There
> are couple of things I'd like to know in this case.
>
> 2.1 What is the best way to run beam directly (instead of going via erl)?
>

For OSE there is no erl wrapper, instead beam is invoked directly. This is
not very beautiful, but it works good enough. You can read about how it is
started here: http://www.erlang.org/doc/apps/ose/ose_intro.html#id56869


>
> 2.2 Can I change fork/execve to pthread_create instead?
>

No, I don't think that would work. What you can do is configure the Erlang
to not use the native dns resolver. This normally this gets rid of most of
the child programs that are needed. See the inet configuration manual for
details on how to do this: http://www.erlang.org/doc/apps/erts/inet_cfg.html
.

Happy porting!

Lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150826/30381e35/attachment.htm>


More information about the erlang-questions mailing list