Erlang - self



One of the most commonly used BIF, returns the pid of the calling processes.

Syntax

self()

Parameters

None

Return Value

Returns the pid of the calling processes.

For example

-module(helloworld). 
-export([start/0]). 

start() -> 
   io:fwrite("~p~n",[self()]).

Output

When we run the above program, we will get the following result.

<0.2.0>
erlang_processes.htm
Advertisements