[erlang-questions] Erlang, OpenBSD and multicore

Raimo Niskanen raimo+erlang-questions@REDACTED
Mon Jul 6 11:48:01 CEST 2009

On Fri, Jul 03, 2009 at 01:13:22PM +0200, Jérôme Desquilbet wrote:
> I am using OpenBSD as an OS on my server, and Erlang as well. I am
> considering now to upgrade to an Intel dualcore platform, taking
> advantage of OpenBSD support for SMP (see
> http://openbsd.org/faq/faq8.html#SMP ). I understand that Erlang won't
> automatically detect the dualcore with OpenBSD (as it would with some
> Linuxes). But will everything be OK if I "force" the CPU topology with
> erlang:system_flag()? Or is there a known supportability issue with OpenBSD?
> Thanks,
>   Jérôme.

Well, OpenBSD's SMP support is as far as I know limited to scheduling
different processes on different CPU core. A process that uses multiple
threads (as Erlang's SMP emulator) gets user threads within one
OS process hence one Erlang emulator can only utilize one CPU core.

For better SMP on OpenBSD you have to build an RTHREADS-enabled kernel
and librthread.so, and link (dynamically) the Erlang emulator against it.
This is highly unsuported, not even alpha status, for testing only,
and RTHREADS only parallellize disk IO (at least not network IO).
I ment to try this but has not got around to it yet.

A dualcore platform can still be interesting since on any normal
system there is other things for the other CPU core to do,
or you can run two Erlang emulators.

> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org


/ Raimo Niskanen, Erlang/OTP, Ericsson AB

More information about the erlang-questions mailing list