Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Identify core an Erlang process

Tags:

erlang

Any way to identify the specific core an Erlang process is scheduled on?

Let's say you spawn a bunch of processes to simply print out the core the process is running on, and then exit. Any way to do this?

I spent some time reading docs and googling but couldn't find anything.

Thanks.

EDIT: "core" = CPU core number (or if not number, another identifier that identifies the CPU core).

like image 535
user1992634 Avatar asked Dec 28 '25 23:12

user1992634


1 Answers

There is erlang:system_info(scheduler_id) that in most cases is maped to a logical core. But this information is pretty ephemeral because the process may be suspended and resumed on any other scheduler.

What is your use case that you really need that kind of information?

like image 165
Dmitry Belyaev Avatar answered Dec 31 '25 21:12

Dmitry Belyaev