Erlang:获取与”pid”关联的”注册名称”

Erlang: getting the "registered name" associated with a `pid`

是否有直接的方法来检索与 pid() 关联的 registered name ?还是我必须遍历 registered() 名称并在列表的每个元素上执行 whereis() 才能找到它?


查看 erlang:process_info/2 和这个 ItemSpec:

{registered_name, Atom}

Atom is the registered name of the process. If the process has no registered name, this tuple is not present in the list.

PS。为什么要这个反向映射?只是为了交互式调试吗?