[erlang-questions] "processor affinity" for processes
Fri Jan 18 04:03:03 CET 2008
I don't recall seeing any code in the emulator that would actually set
CPU affinity masks. Though it would be a nice feature to have.
> Hi David,
> but what if I want to run two Erlang nodes on on dual CPU machine?
> Will commands bellow work?
> ~/Desktop/tmp% erl -sname cpu1 +S 1
> ~/Desktop/tmp% erl -sname cpu2 +S 1
> Will each of them grab it's own CPU, or this will be left to the mercy of
> David King-6 wrote:
>>> There are also need to control number of CPUs/cores Erlang VM using,
>>> the rest we can use for ports or another non-Erlang external
>> You can already do this.
>> ~/Desktop/tmp% erl
>> Erlang (BEAM) emulator version 5.6 [source] [smp:2]
>> ~/Desktop/tmp% erl +S 1
>> Erlang (BEAM) emulator version 5.6 [source] [smp:1]
>> From the man page:
>> +S Number:
>> Sets the number of scheduler threads to use when SMP
>> support has been enabled. Valid range is 1-1024. If the Erlang
>> runtime system is able to determine the number of
>> processor cores available, the default value will equal the this
>> value; otherwise, the default value will be one.
>> This flag will be ignored if the emulator doesn't have
>> SMP support enabled (see the -smp flag).
>> erlang-questions mailing list
More information about the erlang-questions